Skip to content
Snippets Groups Projects
Commit 46a64c4a authored by voic00's avatar voic00
Browse files

..

parent ca9ca7b3
No related branches found
No related tags found
No related merge requests found
......@@ -122,6 +122,25 @@ def solve_bipartite_minimization(input_lines):
for b in remaining_nodes:
neighbors_a[b].sort(key=lambda a: a)
for b in remaining_nodes:
print(f"{b}: {neighbors_a [b]}")
#erstelle eine Liste an Intervallen in denen sich mehrere höher gradige Knoten schneiden.
intervalle = []
#als erstes brauchen wir eine liste aller Knoten mit hohem grad sortiert nach ihrem kleinsten Wer in A
remaining_nodes.sort(key=lambda b: neighbors_a[b][0])
print(remaining_nodes)
# Dann schauen wir uns b_1 den rechtesten Nachbarn in A (a_{1R}) von b_1 an. Wähle den nächsten Knoten in B (b_2) sollte der linkeste Knoten in A (a_{2L}) links von a_{1R} sein
# so prüfen wir, ob a_{1R} rechts von a_{2R} ist. ist a_{2R} rechter, so nehmen a_{2R} als neue rechte Schranke und itereieren so weiter
# sollte der nächste knoten disjunkt sein, so fangen wir von vorne an
# linke_schranke, rechte_schranke = remaining_nodes[0][0], remaining_nodes[0][-1]
# for i in range(1, len(remaining_nodes)):
if len(remaining_nodes)==0:
return degree_one_nodes
......@@ -147,7 +166,7 @@ def solve_bipartite_minimization(input_lines):
max_cycle_length = 9
while True:
prob.solve(PULP_CBC_CMD(msg=0))
prob.solve()#(PULP_CBC_CMD(msg=0))
if prob.status != LpStatusOptimal:
break
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment