mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-30 17:40:45 +00:00
correct gcolor difficulty
This commit is contained in:
parent
4109b5b72c
commit
4ea70e2ce4
1 changed files with 8 additions and 5 deletions
|
|
@ -197,6 +197,9 @@ class GraphColorDataset(ProceduralDataset):
|
|||
num_colors=num_colors,
|
||||
)
|
||||
solution = greedy_graph_coloring(puzzle)
|
||||
if not solution:
|
||||
num_vertices = rng.randint(self.config.min_num_vertices, self.config.max_num_vertices)
|
||||
num_colors = rng.randint(self.config.min_num_colors, self.config.max_num_colors)
|
||||
|
||||
edges = str(puzzle["edges"])
|
||||
question = f"""Please provide a coloring for this graph such that every vertex is not connected to a vertex of the same color. The graph has these properties:
|
||||
|
|
@ -253,21 +256,21 @@ class GraphColorCurriculum(BaseCurriculum):
|
|||
self._define_attributes(
|
||||
RangeAttributeDefinition(
|
||||
name="num_vertices",
|
||||
levels=[10, 20, 30, 40],
|
||||
levels=[10, 12, 15, 18],
|
||||
default_level=0,
|
||||
description="Number of vertices in the graph",
|
||||
attr_type=AttributeType.APPEND,
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=10,
|
||||
lower_field_name="min_num_vertices",
|
||||
upper_field_name="max_num_vertices",
|
||||
),
|
||||
RangeAttributeDefinition(
|
||||
name="num_colors",
|
||||
levels=[3, 4, 5, 6],
|
||||
levels=[5, 4, 3],
|
||||
default_level=0,
|
||||
description="Number of colors in the graph",
|
||||
attr_type=AttributeType.APPEND,
|
||||
min_value=2,
|
||||
attr_type=AttributeType.STATIC,
|
||||
min_value=3,
|
||||
lower_field_name="min_num_colors",
|
||||
upper_field_name="max_num_colors",
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue