Skip to content
Snippets Groups Projects
Commit e0f86229 authored by Robert Samal's avatar Robert Samal
Browse files

Values of MILP.

parent 06433271
Branches
No related tags found
No related merge requests found
......@@ -30,8 +30,11 @@ def solve_gadget(g, alt_gadgets):
for ag in alt_gadgets: gadget_to_constraint(ag)
P.set_objective(gadget_to_poly(g))
P.show()
return (floor(P.solve()), 2**(g.eval(UnderlayingGraph)[0].value.num_verts()//2))
print (floor(P.solve()), 2**(g.eval(UnderlayingGraph)[0].value.num_verts()//2))
for i, v in sorted(P.get_values(V).items()):
print('w_%s = %s' % (i, v))
G4 = [
Gadget.join([CUBIC_VERTEX] * 2, [((1,1), (2,1))], [ (1,2), (1,3), (2,2), (2,3) ]),
......@@ -49,5 +52,5 @@ G5 = [
Gadget.join([CUBIC_VERTEX] * 3, [((1,1), (2,1)), ((2,2), (3,2))], [ (1,2), (1,3), (2,3), (3,1), (3,3) ]),
]
print(solve_gadget(sun(5), G5))
print(solve_gadget(sun(4), G4))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment