Skip to content

Commit 83a3007

Browse files
Saatvik RaosaatvikraoIITGN
authored andcommitted
simplified test cases
1 parent 49745af commit 83a3007

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/sage/graphs/graph.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4992,18 +4992,11 @@ def minor(self, H, solver=None, verbose=0, *, integrality_tolerance=1e-3, induce
49924992
49934993
Trying to find an induced minor for a graph with a C6 cycle::
49944994
4995-
sage: import random
4996-
sage: g = Graph()
4997-
sage: cycle_vertices = [g.add_vertex() for _ in range(6)]
4998-
sage: for i in range(6): # Connect the vertices to form a C6 cycle
4999-
....: g.add_edge(cycle_vertices[i], cycle_vertices[(i + 1) % 6])
5000-
sage: num_additional_vertices = random.randint(10, 30) # Add a random number of additional vertices
5001-
sage: additional_vertices = [g.add_vertex() for _ in range(num_additional_vertices)]
5002-
sage: for vertex in additional_vertices: # Connect the additional vertices to the cycle randomly
5003-
....: random_cycle_vertex = random.choice(cycle_vertices)
5004-
....: g.add_edge(random_cycle_vertex, vertex)
5005-
sage: h = Graph([(i, (i + 1) % 5) for i in range(5)]) # Create a graph with 5 vertices forming a C5 cycle
5006-
sage: L = g.minor(h, induced=True))
4995+
sage: g = graphs.CycleGraph(6) # Create a graph with 6 vertices forming a C6 cycle
4996+
sage: for i in random.randint(10, 30):
4997+
....: g.add_edge(random.randint(0, 5), i)
4998+
sage: h = graphs.CycleGraph(5) # Create a graph with 5 vertices forming a C5 cycle
4999+
sage: L = g.minor(h, induced=True)
50075000
sage: gg = g.subgraph(flatten(L.values(), max_level = 1))
50085001
sage: _ = [gg.merge_vertices(l) for l in L.values() if len(l)>1]
50095002
sage: gg.is_isomorphic(h)

0 commit comments

Comments
 (0)