
    Gd                        d Z ddlZddlmZ ddlZddlZ	 e	j
        dd          Z ee	j                            e                    Z ede            ed            e	j        e          Z ej        e          \  ZZ edeez
                                  eez
                                  z   dz                ee            e	j        ee          Z ed	            ej        e          \  ZZ edeez
                                  eez
                                  z   dz                ee            ej        e                                d
ddd            ej                     dS )z
======================
Reverse Cuthill--McKee
======================

Cuthill-McKee ordering of matrices

The reverse Cuthill--McKee algorithm gives a sparse matrix ordering that
reduces the matrix bandwidth.
    N   orderingzunordered Laplacian matrixzbandwidth:    )nodelistzlow-bandwidth Laplacian matrixFTg      ?)cbarsquare
linewidthsannot)__doc__numpynpmatplotlib.pyplotpyplotpltseabornsnsnetworkxnxgrid_2d_graphGlistutilsreverse_cuthill_mckee_orderingrcmprintlaplacian_matrixAnonzeroxymaxBheatmaptodenseshow     6share/doc/networkx-3.1/examples/algorithms/plot_rcm.py<module>r)      s  	 	                   BQ
d282215566 j#    " # # #Brz!}}1 7QUKKMMQUKKMM1A577 8 8 8 aBC((( & ' ' 'rz!}}1 7QUKKMMQUKKMM1A577 8 8 8 a AIIKKeDS M M M M 




r'   