Example #1
0
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
Example #2
0
def test_MLKWayPartMgr():
    H = read_json("testcases/p1.json")
    totalcost = run_MLKWayPartMgr(H, 3)
    assert totalcost >= 77
    assert totalcost <= 197
Example #3
0
def test_FMBiPartMgr4():
    H = read_json("testcases/p1.json")
    part = [0 for _ in H]
    run_FMBiPartMgr(H, part)
Example #4
0
def test_MLBiPartMgr2():
    H = read_json("testcases/p1.json")
    totalcost = run_MLBiPartMgr(H)
    assert totalcost >= 43
    assert totalcost <= 105
Example #5
0
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)