Walls as Edges
Draw a plan in CAD and you get a pile of line segments. Ask that pile which two rooms a particular wall separates and it has no idea. It knows where the ink is. It does not know who the neighbors are. That is the whole problem: the useful fact about a wall is not its geometry, it’s the pair of rooms on either side of it.
Three drawn lines, four room-pair edges
Four rectangular rooms on one plate. Walls are counted two ways: as drawn lines (one full-height vertical W1, two horizontal segments W2 and W3) and as room-pair edges, one for each pair of rooms that shares a length of wall. W1 carries two edges. Diagonal rooms meet only at the crossing point and share no edge. Internal length is counted once; the outer boundary is reported separately. Wall thickness, ratings and openings are not modelled.
The wall as an edge
Treat every room as a node in a graph. A wall is an edge: the connection, and the separation, between exactly two nodes. (Quick glossary: a node is a thing, an edge is a relationship between two things, and two nodes are adjacent when an edge joins them.) Once walls are edges, a floor plan stops being a drawing you interpret and becomes a structure you can query.
The outside is a node too. An exterior wall is an edge between a room and the outdoors, which is why a plan can list exterior edges separately from room-to-room ones. The exhibit counts only the room-to-room edges.
Three lines, four edges
The smallest example that shows the difference: four rooms on a 36 × 24 ft plate, split by one vertical and one horizontal partition that cross in the middle. Count walls the way a drafter does and you get three lines: a 24 ft vertical (W1) and two 18 ft horizontal segments (W2 and W3). Sixty feet of interior wall.
Count them the way the graph does and you get four edges:
- R1↔R2, 12 ft, on the top half of W1
- R3↔R4, 12 ft, on the bottom half of W1
- R1↔R3, 18 ft, on W2
- R2↔R4, 18 ft, on W3
Same 60 ft. Different count, and the difference is the point. W1 is one line in the drawing and two relationships in the building. A door cut into its top half joins R1 and R2. Slide that door 12 ft down the same line and it joins R3 and R4 — a different pair of rooms, possibly a different code question, on what the CAD file thinks is a single object.
And R1 and R4, which visibly touch at the crossing, share no edge at all. They meet at a point. There is no wall between them to put a door in, so the only way from R1 to R4 is through R2 or R3. The drawing shows four rectangles touching. The graph tells you it’s a ring.
What moves and what doesn’t
In the drawing, drag the crossing. Room areas move, and every edge length moves: pull the crossing 70% across and 65% down and the four edges become 15.6, 8.4, 25.2 and 10.8 ft. Two things stay put. The total is still 60 ft, because on a fixed plate the two partitions always add up to width plus depth. And the graph is still four edges with the diagonals unconnected. Change the plate instead and the total follows it: 54 ft wide gives 78 ft, 36 ft deep gives 72 ft. The cyan bridges, E1 through E4, mark which run of wall belongs to which pair.
Geometry is the variable. Topology is the constant. A plan tool should know which of the two you just changed.
What the graph knows
Store walls as edges between rooms and a handful of questions that are tedious on a drawing become lookups:
- Who touches whom. Adjacency is the edge list. No eyeballing, no squinting at whether that wall really runs continuously behind the column.
- Where a door can go. A door is an attribute on an edge. No edge, no door. Which rooms people can walk between is a choice made on top of which rooms touch, so the door graph is always a subset of the wall graph.
- Which rule fires. Many code requirements for walls are written as pairs: a dwelling unit next to a corridor, a unit next to another unit, one occupancy next to a higher-hazard one. Those are edge questions. The graph can flag which edges trigger a requirement before anyone has picked an assembly.
- What a revision actually did. Drag a partition and the graph can tell you whether you changed a length or changed a relationship. One changes quantities. The other can change circulation, access to light, how a dwelling relates to its corridor, the spec, the door schedule, and possibly the code path.
- How much wall there is. Interior wall length is the sum of edge lengths, each shared run counted once, never once per room. In my view wall footage is one of the biggest levers on interior cost, and some efficient plan types are partly graph shapes: a double-loaded corridor is a hub, with one corridor node serving two rows of unit nodes, each unit holding an edge to the corridor and party-wall edges to its neighbors.
What the graph doesn’t know
An edge says which two rooms a wall sits between. It says nothing about what the wall is. A wall might give privacy, separate different uses, carry structure, or help control fire and sound, and which of those it has to do depends on what the two rooms need from each other. The graph is a way to make those relationships explicit, not a substitute for detailing: real performance depends on the assembly, its connections and the project’s applicable requirements, and the applet above models none of it, not thickness, not ratings, not openings. This page asks which two rooms a wall connects; thesis 31, Walls Between Cells, asks what the boundary between them has to be — its rating, its assembly, and which side gives up floor area to its thickness.
Structure sits outside the graph too. A bearing wall is an edge the structural engineer also has a claim on. The graph can tell you which rooms it separates. It can’t tell you whether it can move.
Store the pair, draw the line
Asking what each boundary separates before copying a typical detail is the habit the graph supports, and it leaves a record of why an assembly changed when the use on either side did. A plan tool that keeps walls as free-standing lines makes you re-derive adjacency by eye every time something moves, and it can’t tell a length change from a relationship change. A tool that keeps rooms as nodes and walls as edges gets adjacency, door eligibility, code triggers and wall quantities from the same structure, and draws the lines last. I’d rather author the rooms and let the walls fall out of the topology than draw walls and hope the rooms come out the way I meant.