We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 719da79 commit 4f43023Copy full SHA for 4f43023
backtracking/m_coloring_problem.py
@@ -14,8 +14,7 @@ def is_safe(
14
True
15
"""
16
return all(
17
- not (graph[node][k] == 1 and col[k] == color)
18
- for k in range(num_vertices)
+ not (graph[node][k] == 1 and col[k] == color) for k in range(num_vertices)
19
)
20
21
@@ -45,9 +44,7 @@ def solve(
45
44
return False
46
47
48
-def graph_coloring(
49
- graph: list[list[int]], max_colors: int, num_vertices: int
50
-) -> bool:
+def graph_coloring(graph: list[list[int]], max_colors: int, num_vertices: int) -> bool:
51
52
Determine if the graph can be colored with at most max_colors.
53
0 commit comments