How this calculation works
A target graph is a topological minor of a source when some subgraph of the source is a subdivision of the target. Every target vertex becomes a distinct branch vertex, while each target edge becomes a path linking the appropriate branch pair.
Enumerate injective assignments of target branch vertices to source vertices. For each target edge enumerate simple source paths between its chosen endpoints. Forbid every other branch vertex as an internal path vertex. Backtrack over edge paths while forbidding overlap of their internal vertices and source edges; shared branch endpoints are allowed only as prescribed. Replay all paths; assert distinct branch vertices and pairwise-disjoint interiors. Exhausted assignment/path combinations prove no subdivision embedding; resource cap unresolved.A worked example
With the prefilled inputs, exists = Yes.
Good to know
Distinct branch vertices and pairwise internally vertex-disjoint routes; internal routes avoid all branch vertices.
Reference: Primary method reference or author-maintained documentation (opens in a new tab) ↗
A topological minor is a subdivided copy
A target graph is a topological minor of a source when some subgraph of the source is a subdivision of the target. Every target vertex becomes a distinct branch vertex, while each target edge becomes a path linking the appropriate branch pair.
Subdivision inserts degree-two vertices along edges. The paths representing different target edges may share a prescribed branch endpoint, but their interiors must be disjoint. These conditions are stronger than simply asking for each required pair to be connected somewhere in the source.
Compare with the Graph minor calculator with deletion and contraction certificate. Find a subdivision of a target with internally disjoint edge paths; branch-set contraction certificates can exist without such subdivisions.
Declare branch vertices through an injection
Use the prefilled input structure and preserve the declared column or index order. The input consists of two simple undirected graphs. Every target vertex must be assigned to a different source vertex, and each assigned branch vertex must have enough available incident structure to support its target degree. Degree checks are useful pruning, not complete proofs of existence.
The source may contain unused vertices and edges. A witness identifies only the subgraph used for the subdivision; extra source edges do not invalidate that witness. Consequently, this is a subgraph containment problem rather than an induced-subgraph problem.
Build paths without stealing another branch vertex
For a fixed branch assignment, enumerate simple source paths for every target edge. A candidate path must not pass internally through a source vertex assigned to a different target vertex. Such a passage would collapse two separate roles in the proposed subdivision.
During backtracking, reserve each path's internal vertices and edges. Sharing is permitted only at common branch endpoints corresponding to adjacent target edges. Completing all target edges supplies a positive certificate; failure is conclusive only after every allowed assignment and path choice has been exhausted.
Find a triangle subdivision in a four-cycle
Take the four-cycle zero–one–two–three–zero and the triangle on target vertices A, B and C. Map A, B and C to zero, one and two. Use source paths zero–one, one–two and zero–three–two for its three target edges.
The first two paths have no internal vertices. The third uses only vertex three internally, so the interiors are disjoint and none contains another branch vertex. This is a valid triangle subdivision even though the four-cycle has no three-vertex triangle subgraph.
Draw the subdivision paths separately
Color or dash the three selected paths by their target edge and mark the branch vertices with larger labeled nodes. The fourth vertex should appear as an ordinary path vertex. A small target triangle alongside the source helps explain which source paths replace its edges.
Provide the explicit vertex sequence of every path beneath the SVG. Readers can then verify consecutive adjacency, distinct internal vertices and correct endpoints without interpreting a crowded drawing. The certificate remains usable when printed in monochrome or viewed without the visualization.
Ordinary minors allow more flexibility
An ordinary minor model can contract connected branch sets containing several source vertices. A topological-minor model instead requires single branch vertices linked by internally disjoint paths. A graph can contain a target as an ordinary minor without containing the needed subdivision.
A shortest path chosen greedily for one target edge can block all routes for another edge. That does not imply nonexistence; another, longer first path may permit the entire model. Exact search must backtrack across those choices rather than making independent shortest-path decisions.
Keep the no-answer tied to complete search
The source accepts at most nine vertices and sixteen edges, while the target accepts at most five vertices and eight edges. A bounded search coordinates branch assignments and simple paths. Exhausting the work budget raises an unresolved error; an ordinary false result is reserved for a completed finite search with no witness.
Validate a positive answer directly from its path table. Negative regression cases should include degree obstructions and connected sources that lack enough disjoint routes despite having all required endpoints connected. The distinction exercises the actual subdivision condition rather than only graph connectivity. The public prefill uses this four-cycle and a triangle target, although the target edge list may use a different order. Returned path rows correspond to that submitted edge order. Always pair each row with its own target endpoints before checking branch and internal vertices; sorting the rows independently could scramble an otherwise valid certificate. Distinct branch vertices and pairwise internally vertex-disjoint routes; internal routes avoid all branch vertices.
A few questions, answered
Can two target-edge paths share a source vertex?
They can share a branch endpoint when the corresponding target edges meet. Their internal vertices must remain disjoint.
Does a four-cycle contain a triangle topologically?
Yes. Suppressing one degree-two vertex turns the cycle into a triangle, and the three explicit paths provide a subdivision witness.
Are extra source edges forbidden?
No. The witness is a subdivision subgraph. Unused edges outside the chosen paths are allowed.
Why not run shortest paths separately for each edge?
Independently chosen routes may overlap internally. The algorithm must coordinate all path choices and backtrack when they conflict.