#πŸ”’ graph color refinement algorithm bug fix

6 messages Β· Page 1 of 1 (latest)

stray cobalt
#

my algorithm for graph color refinement has a bug when color refining some graphs.
it starts to loop infinitely, while renewing all colors, but the colors stay relatively the same (the distance between them), which is pointless.
so i made a fix, which is the string at label 1. but this still gets the amount of iterations wrong, which i do need to have correct.
i think the issue lies in the refine() function but i cant tell for sure.
would really appreciate some help.
graph that it would fail on:

# Number of vertices:
9
# Edge list:
1,2
5,1
8,2
3,6
3,4
5,6
7,6
4,1
0,7
2,0
8,4
3,5
--- Next graph:
# Number of vertices:
9
# Edge list:
4,8
6,3
2,7
0,8
0,3
5,8
4,1
5,6
4,2
7,0
1,6
5,3
--- Next graph:
# Number of vertices:
9
# Edge list:
4,2
4,7
8,2
7,8
0,6
2,5
4,6
5,1
3,0
1,8
7,6
3,1
--- Next graph:
# Number of vertices:
9
# Edge list:
0,3
2,4
1,6
5,4
3,2
6,4
8,7
0,7
1,5
8,6
7,1
0,8
--- Next graph:
# Number of vertices:
9
# Edge list:
5,1
1,2
7,0
5,6
7,8
4,0
3,2
4,2
6,3
0,8
5,7
1,8```
drowsy spadeBOT
drowsy spadeBOT
#

@stray cobalt

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

stray cobalt
#

omp

drowsy spadeBOT
#

@stray cobalt

Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.