def test_readjson(): H = read_json("testcases/p1.json") count_2 = 0 count_3 = 0 count_rest = 0 for net in H.nets: deg = H.G.degree(net) if deg == 2: count_2 += 1 elif deg == 3: count_3 += 1 else: count_rest += 1 print(count_2, count_3, count_rest) assert count_2 == 494
def test_MLKWayPartMgr(): H = read_json("testcases/p1.json") totalcost = run_MLKWayPartMgr(H, 3) assert totalcost >= 77 assert totalcost <= 197
def test_FMBiPartMgr4(): H = read_json("testcases/p1.json") part = [0 for _ in H] run_FMBiPartMgr(H, part)
def test_MLBiPartMgr2(): H = read_json("testcases/p1.json") totalcost = run_MLBiPartMgr(H) assert totalcost >= 43 assert totalcost <= 105
def test_FMKWayPartMgr4(): H = read_json("testcases/p1.json") gainMgr = FMKWayGainMgr(FMKWayGainCalc, H, 3) part = [0 for _ in H] run_FMKWayPartMgr(H, gainMgr, 3, part)