A robot route model can require every graph link to be inspected once, rather than merely reaching a destination. A shortest path between two nodes answers a different question: it can ignore most of the links that the inspection task requires.

For an undirected graph, the existence of a walk using every required edge exactly once is governed by connectivity and vertex-degree parity. Such a walk is called an Euler trail. If it ends where it starts, it is an Euler circuit. Repeated vertices are allowed; repeated edges are not.

The graph below is an original teaching model. It does not encode a real facility, collision constraints, turning costs, or robot motion. No route planner or graph library was executed.

Declare five distinct required edges

Use vertices A, B, C, and D. The required undirected edges are AB, BC, CD, DA, and AC. The first four form a square; AC is a diagonal in a convenient drawing. The drawing itself adds no intersections or vertices beyond those explicitly declared.

Vertex A has degree three because AB, DA, and AC meet there. Vertex C also has degree three. Vertices B and D each have degree two. The graph is connected, and exactly two vertices have odd degree.

NetworkX documents the zero-or-two-odd-degree condition for an undirected Euler path, together with connectivity and starting-node requirements. MathWorld gives the underlying edge-once definition. Here these facts are used to construct and check an independent route explicitly.

Write a complete trail

The vertex sequence A–B–C–D–A–C traverses AB, BC, CD, DA, and AC, in that order. Each of the five required edges occurs once. The sequence contains six vertex positions, because a walk with five traversals lists both its initial position and each subsequent arrival.

A appears twice and C appears twice. That is permitted. Confusing an edge-once trail with a vertex-once path would reject a valid inspection sequence for the wrong reason.

The trail starts at A and ends at C, precisely the two odd-degree vertices. Reversing its order gives a valid trail from C to A. The choice of direction for the whole walk does not change which undirected edges it covers.

Why parity identifies the endpoints

At any intermediate visit to a vertex, an arrival along one edge must be paired with a departure along another unused edge. These pairs consume an even number of incident edges over the complete walk.

An open walk has one unmatched departure at its start and one unmatched arrival at its end. Those vertices therefore have odd degree when every required edge is consumed. Every other vertex must have even degree.

For a closed walk, the final arrival pairs with the initial departure, so all vertices must have even degree. This counting argument explains the necessity of the parity condition without relying on a planner's returned route.

Connectivity supplies the other necessary ingredient. Edges in separate connected components cannot be joined into one continuous walk without adding a connection or leaving the graph.

A requested start can make the task impossible

Suppose the same five-edge inspection must start at B. The graph still has an Euler trail, but none starting at B and using each edge exactly once. B has even degree, while the only possible endpoints of an open Euler trail are A and C.

This is not evidence that B is unreachable. It is reachable, and ordinary paths from B to every other vertex exist. The constraint combines an assigned start with a requirement to consume every edge once.

If repeated traversal is permitted, a walk starting at B can cover the graph. It then solves a different task. A report should state whether extra traversals are allowed, rather than calling any covering walk an Euler trail.

Closing the route requires another traversal

Give the edges positive abstract travel costs: AB costs two, BC three, CD four, DA five, and AC one. The five required edges total fifteen cost units. Every edge-once inspection has that same total, regardless of its ordering.

The graph has no closed edge-once walk because A and C have odd degree. If an additional traversal of AC is allowed, count it as a second edge instance for route accounting. A and C then each have degree four.

A closed covering walk is A–B–C–D–A–C–A. It costs sixteen units and uses AC twice. This is a circuit in the augmented multigraph, but it repeats an edge of the original required graph.

The extra cost of one is minimal in this particular example. Any closed covering walk must add traversals that correct the two odd endpoints. A connection between A and C is required in the added traversal accounting, and the direct AC edge already has the smallest possible positive connection cost here.

That argument certifies the small example. It does not imply that duplicating a visually short edge solves every larger route-covering problem.

Parity alone cannot join components

Consider a separate graph consisting of two disconnected triangles. Every vertex has degree two, so there are no odd-degree vertices. Each triangle has its own Euler circuit, yet no single walk covers both components.

Adding a degree-zero vertex creates a different convention issue. For a task defined only by required edges, an isolated marker contributes no inspection edge and can be excluded from the active support. NetworkX's documented function instead treats a graph containing isolated vertices as disconnected and returns false under that convention.

The mathematical task and the software graph should therefore agree about which vertices belong to the required structure. This article does not claim a runtime result from the documented function.

Keep the route objective explicit

Euler traversal concerns edges exactly once. A Hamiltonian question concerns visiting vertices once. Shortest-path and maximum-flow models optimize still other quantities. Sharing a graph representation does not make these questions interchangeable.

For an edge-inspection record, retain the required edge identities, directions, active connectivity, permitted start and finish, and policy on repeat traversals. Those details determine whether the parity result applies to the task actually described.

Sources checked October 24, 2026:

https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.euler.has_eulerian_path.html — NetworkX 3.7 documentation as accessed; undirected Euler-path parity, connectivity, chosen source, and isolated-vertex convention read. No NetworkX execution is claimed.

https://mathworld.wolfram.com/EulerianPath.html — Eric W. Weisstein, MathWorld, Eulerian Path; authored definition and connected-graph odd-degree criterion read. No article-specific revision date is inferred from the site footer.

Illustration note: A generic robot and laptop workspace is a concept illustration. It does not show this invented example, measured robot performance, or an executed software test.