#NEWLINE# @ preserve_random_state #NEWLINE# def test_disconnected( self ) : #NEWLINE# #INDENT# G = nx . Graph ( ) #NEWLINE# nx . add_path ( G , range ( 0 , 10 , 2 ) ) #NEWLINE# nx . add_path ( G , range ( 1 , 10 , 2 ) ) #NEWLINE# for method in self . _methods : #NEWLINE# #INDENT# order = nx . spectral_ordering ( G , method = method ) #NEWLINE# assert_equal ( set ( order ) , set ( order ) ) #NEWLINE# seqs = [ list ( range ( 0 , 10 , 2 ) ) , list ( range ( 8 , ( - 1 ) , ( - 2 ) ) ) , list ( range ( 1 , 10 , 2 ) ) , list ( range ( 9 , ( - 1 ) , ( - 2 ) ) ) ] #NEWLINE# ok_ ( ( order [ : 5 ] in seqs ) ) #NEWLINE# ok_ ( ( order [ 5 : ] in seqs ) )