Skip to content

Commit 4f43023

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 719da79 commit 4f43023

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

backtracking/m_coloring_problem.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ def is_safe(
1414
True
1515
"""
1616
return all(
17-
not (graph[node][k] == 1 and col[k] == color)
18-
for k in range(num_vertices)
17+
not (graph[node][k] == 1 and col[k] == color) for k in range(num_vertices)
1918
)
2019

2120

@@ -45,9 +44,7 @@ def solve(
4544
return False
4645

4746

48-
def graph_coloring(
49-
graph: list[list[int]], max_colors: int, num_vertices: int
50-
) -> bool:
47+
def graph_coloring(graph: list[list[int]], max_colors: int, num_vertices: int) -> bool:
5148
"""
5249
Determine if the graph can be colored with at most max_colors.
5350

0 commit comments

Comments
 (0)