import * as $G from "@/core/base/BaseGraph" ; import { JSONInput , IJSONInConfig } from "@/io/input/JSONInput" ; import * as $MC from "@/mincutmaxflow/MinCutMaxFlowBoykov" ; import { JSON_DATA_PATH } from "_/config/test_paths" ; let json = new JSONInput ( { explicit_direction : true , directed : false , weighted : true } ) , mcmf_graph = `${ JSON_DATA_PATH }/min_cut_max_flow_graph.json` , graph , mcmf ; /**
 *
 */ describe ( "MCMF Boykov Tests - " , ( ) => { beforeEach ( ( ) => { graph = json . readFromJSONFile ( mcmf_graph ) ; mcmf = new $MC . MCMFBoykov ( graph , graph . getNodeById ( "A" ) , graph . getNodeById ( "Z" ) ) ; } ) ; describe ( "Base Tests - " , ( ) => { test ( "should instantiate a standard config" , ( ) => { expect ( mcmf . prepareMCMFStandardConfig ( ) ) . toEqual ( { directed : true } ) ; } ) ; } ) ; describe ( "Min Cut Test - " , ( ) => { test ( "should separate the graph in two disjoint sets so that the cost is minimized" , ( ) => { expect ( mcmf . calculateCycle ( ) . cost ) . toBe ( 14 ) ; expect ( mcmf . calculateCycle ( ) . edgeIDs ) . toEqual ( expect . arrayContaining ( [ "A_B" , "B_A" , "C_E" , "E_C" , "C_D" , "D_C" ] ) ) ; } ) ; } ) ; describe ( "Convert to directed Graph Test - " , ( ) => { } ) ; } ) ;