#NEWLINE# def test_triangulation_h3_create_new( self ) : #NEWLINE# #INDENT# self . graph . add_edges_from ( [ ( 'a' , 'b' ) , ( 'b' , 'c' ) , ( 'c' , 'd' ) , ( 'd' , 'a' ) ] ) #NEWLINE# phi1 = Factor ( [ 'a' , 'b' ] , [ 2 , 3 ] , np . random . rand ( 6 ) ) #NEWLINE# phi2 = Factor ( [ 'b' , 'c' ] , [ 3 , 4 ] , np . random . rand ( 12 ) ) #NEWLINE# phi3 = Factor ( [ 'c' , 'd' ] , [ 4 , 5 ] , np . random . rand ( 20 ) ) #NEWLINE# phi4 = Factor ( [ 'd' , 'a' ] , [ 5 , 2 ] , np . random . random ( 10 ) ) #NEWLINE# self . graph . add_factors ( phi1 , phi2 , phi3 , phi4 ) #NEWLINE# H = self . graph . triangulate ( heuristic = 'H3' , inplace = True ) #NEWLINE# self . assertListEqual ( hf . recursive_sorted ( H . edges ( ) ) , [ [ 'a' , 'b' ] , [ 'a' , 'd' ] , [ 'b' , 'c' ] , [ 'b' , 'd' ] , [ 'c' , 'd' ] ] )