The house of Niklaus

Deciding whether a graph can be drawn in one line and passing each edge only once is rather easy. One only needs to calculate the rank of each vertex and look whether there are at most two vertices with an odd rank.
Here there are two such vertices: A and E. These are the possibilities to being and end the strokes to build the graph.

My Image
The house of Nikolaus

The solution to the problem of drawing the house in one stroke ist done with a rule-based approach. The house itself is represented as a set of single-line strokes,. Beginning with a start configuration we define a rule how a line-stroke is added to the existing strokes

My Image

This rule is then applied as long as there are lines to draw left. A simple idea which works perfectly with the Mathematica-built in rule and pattern matching system. The result is a list of all 44 possibilities to draw this house in one stroke.

My Image


Download Notebook, PDF, Open Notebook in browser

RapidWeaver Icon

Made in RapidWeaver