Supplied planar orthogonal drawings of finite incidence graphs #
Drawing data are a finite list of integer vertex positions and a finite list of polygonal routes. Positions follow the declared vertex list and routes follow the edge list, including parallel edge occurrences. All geometric conditions refer to complete real segment supports. The drawing predicate uses loopless graphs with distinct declared vertex labels.
Edge orientation in the input list is immaterial: an incidence route may be listed in either direction. Its endpoints must be the actual incident vertices. Routes are simple, orthogonal, avoid nonincident vertices, and meet other routes only at shared incident vertices.
Main definitions #
Cslib.Complexity.Graph.OrthogonalDrawing: finite position and route data.Cslib.Complexity.Graph.drawingPosition: the displayed point of a declared vertex.Cslib.Complexity.Graph.IsPlanarOrthogonalDrawing: the geometric embedding certificate.Cslib.Complexity.Graph.drawingFits: bounds on all listed integer coordinates.Cslib.Complexity.Graph.drawingWireLength,Cslib.Complexity.Graph.drawingSegmentCount: explicit geometric output costs.
References #
These are the ordinary finite drawing conditions, expressed using Mathlib real segments and the existing listed graph representation.
Vertex positions and edge routes, in their graph-list orders. No graph data are duplicated.
Instances For
Displayed position of a declared vertex, using its first position in the vertex list.
Instances For
A supplied planar orthogonal embedding of the loopless listed graph. Parallel listed edges have distinct simple routes; all contacts are tested in the real plane.
Exactly one position per declared vertex.
Exactly one route per listed edge occurrence.
Labels describe distinct vertices.
- positionsNodup : d.1.Nodup
Distinct declared vertices have distinct positions.
Both endpoints of every edge are declared.
This interface concerns loopless graphs.
- endpoints (i : ℕ) (hi : i < G.edges.length) : let r := d.2.getD i []; let a := G.drawingPosition d G.edges[i].1; let b := G.drawingPosition d G.edges[i].2; List.head? r = some a ∧ List.getLast? r = some b ∨ List.head? r = some b ∧ List.getLast? r = some a
Route endpoints are the incident vertices, in either order.
Every segment is nondegenerate and axis aligned.
Every route has no retracing, repeated points, or self-crossing.
- avoidsVertices (i : ℕ) (hi : i < G.edges.length) (v : ℕ) : v ∈ G.vertices → Orthogonal.realPoint (G.drawingPosition d v) ∈ Orthogonal.support (d.2.getD i []) → v = G.edges[i].1 ∨ v = G.edges[i].2
A route visits only its incident graph vertices.
- contacts (i : ℕ) (hi : i < G.edges.length) (j : ℕ) (hj : j < G.edges.length) : i ≠ j → ∀ p ∈ Orthogonal.support (d.2.getD i []), p ∈ Orthogonal.support (d.2.getD j []) → ∃ v ∈ G.vertices, (v = G.edges[i].1 ∨ v = G.edges[i].2) ∧ (v = G.edges[j].1 ∨ v = G.edges[j].2) ∧ p = Orthogonal.realPoint (G.drawingPosition d v)
Distinct routes intersect only at common graph endpoints.
Instances For
Every listed position and route point lies in the nonnegative integer rectangle.
Instances For
A larger rectangle preserves bounds on every displayed vertex and route point.
The sum of Manhattan lengths of all incidence routes.
Instances For
The number of consecutive segments in all incidence routes.