@@ -22,16 +22,16 @@ def valid_coloring(
2222
2323 Parameters:
2424 neighbours: The list representing which vertices
25- are adjacent to the current vertex.
26- 1 indicates an edge between the current vertex
27- and the neighbour.
28- colored_vertices (list[int]) : List of current color assignments for all vertices
29- (-1 means uncolored).
30- color (int) : The color we are trying to assign to the current vertex.
25+ are adjacent to the current vertex.
26+ 1 indicates an edge between the current vertex
27+ and the neighbour.
28+ colored_vertices: List of current color assignments for all vertices
29+ (-1 means uncolored).
30+ color: The color we are trying to assign to the current vertex.
3131
3232 Returns:
33- bool: True if the vertex can be safely colored with the given color,
34- otherwise False.
33+ True if the vertex can be safely colored with the given color,
34+ otherwise False.
3535
3636 Examples:
3737 >>> neighbours = [0, 1, 0, 1, 0]
@@ -76,17 +76,17 @@ def util_color(
7676 2.5. Uncolor given vertex
7777
7878 Parameters:
79- graph (list of list of int) : Adjacency matrix representing the graph.
80- graph[i][j] is 1 if there is an edge
81- between vertex i and j.
82- max_colors (int) : Maximum number of colors allowed (m in the m-coloring problem).
83- colored_vertices (list of int) : Current color assignments for each vertex.
84- -1 indicates that the vertex has not been colored
85- yet.
86- index (int) : The current vertex index being processed.
79+ graph: Adjacency matrix representing the graph.
80+ graph[i][j] is 1 if there is an edge
81+ between vertex i and j.
82+ max_colors: Maximum number of colors allowed (m in the m-coloring problem).
83+ colored_vertices: Current color assignments for each vertex.
84+ -1 indicates that the vertex has not been colored
85+ yet.
86+ index: The current vertex index being processed.
8787
8888 Returns:
89- bool: True if the graph can be colored using at most max_colors, otherwise False.
89+ True if the graph can be colored using at most max_colors, otherwise False.
9090
9191 Examples:
9292 >>> graph = [[0, 1, 0, 0, 0],
@@ -131,14 +131,14 @@ def color(graph: list[list[int]], max_colors: int) -> list[int]:
131131 otherwise, returns an empty list.
132132
133133 Parameters:
134- graph (list of list of int) : Adjacency matrix representing the graph.
135- max_colors (int) : Maximum number of colors allowed.
134+ graph: Adjacency matrix representing the graph.
135+ max_colors: Maximum number of colors allowed.
136136
137137 Returns:
138- list of int: List of color assignments if the graph can be colored using max_colors.
139- Each index in the list represents the color assigned
140- to the corresponding vertex.
141- If coloring is not possible, returns an empty list.
138+ List of color assignments if the graph can be colored using max_colors.
139+ Each index in the list represents the color assigned
140+ to the corresponding vertex.
141+ If coloring is not possible, returns an empty list.
142142
143143 Examples:
144144 >>> graph = [[0, 1, 0, 0, 0],
0 commit comments