Graph construction: what touches what?
Learn how detected line segments become vertices, edges, intersections, cycles, and adjacency graphs for impossible shape analysis.
By ShapeKeeper · Last reviewed
Once the detector has line segments, it needs a structure it can reason about. Graph construction turns a drawing into vertices, edges, intersections, connected components, and candidate cycles.
This is the moment where the site stops looking at "a picture" and starts asking structural questions: which endpoints meet, which edges cross, how many lines join at a vertex, and whether a loop closes in a way that could support a face, beam, or contradiction.
If you have ever stared at a sketch and thought, "I know these two lines are supposed to touch," you already understand the problem. People repair small gaps automatically. A browser has to be told, through geometry, which marks belong together and which marks are only near each other.
Graph construction from segments A hand-drawn wireframe becomes snapped vertices, graph edges, and an adjacency list. From strokes to graph Small drawing errors are normalized before topology is scored. raw segments snapped vertices A: B, C B: A, C C: A, B adjacency listThe core idea
A graph is a set of nodes and connections. In this site, nodes are usually endpoints or intersections, and connections are line segments. That representation lets the detector count junctions, spot loops, check crossings, and compare local neighborhoods.
The emotional shift is subtle but important: a drawing stops being a pretty outline and becomes a little map of relationships. One vertex says "these parts meet." One edge says "follow this beam." One cycle says "this path comes back to itself, so later rules can ask whether the depth story still makes sense."
Vertex
A point where a segment ends or where two segments intersect. Vertices carry position and degree.
Edge
A cleaned line segment connecting two vertices. Edges carry length, angle, and crossing information.
Degree
The number of edges touching a vertex. A degree-three junction can be a real corner or a suspicious impossible fork.
Cycle
A closed path in the graph. Cycles can represent faces, tunnels, beams, or a loop that later depth rules inspect.
Worked example
A clean triangle creates three vertices and three edges. A cube wireframe creates more vertices, repeated angle families, and multiple rectangular cycles. An impossible trident creates junctions whose endpoint story and prong story disagree. The graph does not know that something is impossible yet, but it gives later rules the facts they need.
In a classroom, this is a good place to slow the activity down. Ask one student to mark every corner with a dot and another to trace every connector with a finger. If they disagree about whether two strokes touch, the detector will probably struggle there too, and that is useful feedback rather than a failure.
| Graph signal | What it can suggest | Why it is not enough alone |
|---|---|---|
| Closed cycle | A face, loop, tunnel, or path that can carry depth relationships. | Many ordinary possible objects contain cycles. |
| High-degree vertex | A complex junction, overdraw, or possible impossible fork. | Sketches and uploads often create accidental extra junctions. |
| Clean crossing | Potential over-under relationship. | Crossing lines in a 2D drawing are not automatically contradictory. |
Mini experiment
Load the cube preset, then clear one connector or leave a tiny gap at one corner. The shape may still look like a cube to your eye, but the graph may no longer contain the same closed cycles. That is a useful lesson: humans complete missing structure automatically; a detector should be more explicit.
Try the same experiment with an impossible-looking frame. Make one corner too soft, then make it crisp again. The change may feel tiny on the canvas, but it can decide whether the graph has a clean loop to hand off to the depth-ordering guide.
Clean graph
Use the cube preset and count how many corners and connectors are obvious before analysis.
Broken graph
Erase one connector or leave a tiny endpoint gap. The drawing may still look complete to you.
Compare
Rerun the detector and watch whether confidence falls or the verdict becomes more cautious.
Sources and a next path
- Wolfram MathWorld: Graph defines the vertex-edge model used by this explanation. Checked 2026-06-23.
- Previous: edge detection
- Next: angle families
When your drawing is ready, test this drawing in the impossible shape detector.
Compare the evidence with graph cycle impossible object and geometry graph explainer before treating a visual contradiction as a definite result.
Maintained by ShapeKeeper, the anonymous ImpossibleShape site administrator. Send corrections or questions to [email protected]. This handle does not imply academic or professional credentials.