#NEWLINE# def test_min_cut_set_( self ) : #NEWLINE# #INDENT# G = zen . DiGraph ( ) #NEWLINE# G . add_node ( 'a' ) #NEWLINE# G . add_node ( 'b' ) #NEWLINE# G . add_node ( 'c' ) #NEWLINE# G . add_node ( 'd' ) #NEWLINE# G . add_node ( 'e' ) #NEWLINE# G . add_node ( 'f' ) #NEWLINE# G . add_node ( 'g' ) #NEWLINE# G . add_node ( 'h' ) #NEWLINE# G . add_edge ( 'a' , 'b' , weight = 10 ) #NEWLINE# G . add_edge ( 'a' , 'c' , weight = 5 ) #NEWLINE# G . add_edge ( 'a' , 'd' , weight = 15 ) #NEWLINE# G . add_edge ( 'b' , 'e' , weight = 9 ) #NEWLINE# G . add_edge ( 'b' , 'f' , weight = 15 ) #NEWLINE# G . add_edge ( 'b' , 'c' , weight = 4 ) #NEWLINE# G . add_edge ( 'c' , 'f' , weight = 8 ) #NEWLINE# G . add_edge ( 'c' , 'd' , weight = 4 ) #NEWLINE# G . add_edge ( 'd' , 'g' , weight = 30 ) #NEWLINE# G . add_edge ( 'g' , 'c' , weight = 6 ) #NEWLINE# G . add_edge ( 'e' , 'f' , weight = 15 ) #NEWLINE# G . add_edge ( 'e' , 'h' , weight = 10 ) #NEWLINE# G . add_edge ( 'f' , 'g' , weight = 15 ) #NEWLINE# G . add_edge ( 'f' , 'h' , weight = 10 ) #NEWLINE# G . add_edge ( 'g' , 'h' , weight = 10 ) #NEWLINE# cut_set = zen . min_cut_set_ ( G , 0 , 7 , 'weight' ) #NEWLINE# self . assertEquals ( 3 , len ( cut_set ) ) #NEWLINE# self . assertTrue ( ( 0 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 6 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 14 in cut_set ) ) #NEWLINE# cut_set = zen . min_cut_set_ ( G , 0 , 7 , 'unit' ) #NEWLINE# self . assertEquals ( 3 , len ( cut_set ) ) #NEWLINE# self . assertTrue ( ( 0 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 1 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 2 in cut_set ) ) #NEWLINE# G . set_weight ( 'd' , 'g' , float ( 'inf' ) ) #NEWLINE# cut_set = zen . min_cut_set_ ( G , 0 , 7 , 'weight' ) #NEWLINE# self . assertEquals ( 3 , len ( cut_set ) ) #NEWLINE# self . assertTrue ( ( 0 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 6 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 14 in cut_set ) ) #NEWLINE# cut_set = zen . min_cut_set_ ( G , 0 , 7 , 'unit' ) #NEWLINE# self . assertEquals ( 3 , len ( cut_set ) ) #NEWLINE# self . assertTrue ( ( 0 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 1 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 2 in cut_set ) ) #NEWLINE# G . set_weight ( 'a' , 'c' , float ( 'inf' ) ) #NEWLINE# G . set_weight ( 'c' , 'f' , float ( 'inf' ) ) #NEWLINE# G . set_weight ( 'f' , 'h' , float ( 'inf' ) ) #NEWLINE# cut_set = zen . min_cut_set_ ( G , 0 , 7 , 'weight' ) #NEWLINE# self . assertEquals ( 3 , len ( cut_set ) ) #NEWLINE# self . assertTrue ( ( 0 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 1 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 2 in cut_set ) ) #NEWLINE# cut_set = zen . min_cut_set_ ( G , 0 , 7 , 'unit' ) #NEWLINE# self . assertEquals ( 3 , len ( G ) ) #NEWLINE# self . assertTrue ( ( 0 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 1 in cut_set ) ) #NEWLINE# self . assertTrue ( ( 2 in cut_set ) )