GraphPaper Editor: Graph Visualization & Rewriting
- GraphPaper Editor is a dual-system framework for interactive graph drawing and transformation, featuring GraphPaper/TULIP for interaction nets and planar_draw for map rendering on orientable surfaces.
- It employs a free-hand digital-paper metaphor that infers user intent from gestures to efficiently create agents, ports, and rewriting rules, streamlining complex graph manipulations.
- Both tools integrate with downstream computation and LaTeX pipelines, supporting dynamic visual trace generation, strategic rewriting, and publication-quality TikZ output.
The term GraphPaper Editor refers to two functionally distinct but methodologically related systems for graph creation, visualization, and transformation: (1) the GraphPaper interface for interaction net rewriting in conjunction with TULIP, and (2) the planar_draw tool for rendering maps on orientable surfaces. These editors are unified by their emphasis on direct, visual, and manipulable representations of graphs and associated transformations, leveraging precise encoding and export pipelines for downstream computation or LaTeX integration (Fernández et al., 2010, Brinkmann, 2 May 2025).
1. Architectural Paradigms and Input Encodings
GraphPaper (interaction nets) operates as a lightweight, stand-alone editor enabling the direct drawing of agents, ports, and interaction-net rewriting rules using a “digital-paper” paradigm. Rather than toolbars or explicit mode toggles, user intent is inferred from drawn shapes and context, supporting rapid structural editing and manipulation (Fernández et al., 2010).
planar_draw (termed “GraphPaper Editor” for maps) ingests combinatorial map encodings in the “planarcode” format, representing embedded graphs through rotation systems—each vertex’s cyclically ordered neighbors terminated by zero. For general surfaces, planar_draw requires an embedding; abstract graphs are first embedded using dedicated tools (e.g., multi_genus or multi_allembed) (Brinkmann, 2 May 2025).
| Editor | Input Schema | Initial Representation |
|---|---|---|
| GraphPaper/TULIP | Hand-drawn nets | Agents, ports, rules, strategies |
| planar_draw (“GraphPaper Editor”) | planarcode (rotation) | Embedded map on orientable surface |
This design allows both editors to integrate with computational systems: GraphPaper exports to TULIP for rewriting execution; planar_draw produces TikZ output for LaTeX workflows.
2. User Interface and Interaction Models
GraphPaper applies a free-hand digital-paper metaphor: circles create agents; overlapping circles yield lasso-selection; connecting two ports with a line creates an edge; lines “sticking out” establish auxiliary ports at the drawn position. Port management is automatic—labeling an agent with arity results in ports (principal plus auxiliaries), enumerated , with principal port always at zero (Fernández et al., 2010).
There are two primary states:
- Draw state (shape recognition for agent/port/edge creation and deletion)
- View/Edit state (object selection, renaming, panning, zooming, deletion via lasso)
Rule-drawing mode is triggered by lasso-selecting two agents at principal ports; the user then draws the rule’s right-hand side and matches free ports explicitly.
planar_draw operates via command-line flags and modifies rendering options in the TikZ header. Readers select the location of the fundamental polygon’s “common center,” tune which edges/faces are intersected by non-contractible cycles, and apply color or label styles to polygonal boundary segments or nodes (Brinkmann, 2 May 2025).
3. Graph Representation and Rewrite Models
GraphPaper formalizes interaction-net systems as where is a finite set of agent symbols (with fixed arity) and is a set of binary interaction rules. Each agent is depicted as a circle with labeled ports, uniquely identifying principal and auxiliary positions. In LaTeX notation, left-hand sides are rendered as
with explicit bijection between free ports of the active pair and the replacement net (Fernández et al., 2010).
Rewrite semantics are strictly local: when two agents meet at principal ports, and a rule matches the interface, the region is replaced with with free port correspondences preserved. This yields strong confluence—any two reductions commute and no critical pairs arise.
planar_draw, by contrast, represents combinatorial maps on orientable surfaces. Each embedding specifies oriented edges and a rotation (the “n” map) encoding clockwise succession at vertices. The genus is recovered via the Euler characteristic ; non-contractible cycles are used to cut the surface into a fundamental $4g$-gon for planarization (Brinkmann, 2 May 2025).
4. Algorithmic Pipelines and Visualization Workflows
GraphPaper/TULIP Workflow:
- Draw nets using gestures; automatically manage ports/edges.
- Define rules via lasso and explicit right-hand-side drawing.
- Specify strategies using a domain-specific language (DSL) for rule application sequencing, depth, and interface targeting.
- Export to TULIP, which implements over a dozen dynamic layout algorithms and provides a visual trace of each rewrite step.
- Simulate and debug: dynamic rendering, strategy execution, branching trace-tree navigation, alternate layouts, and interactive state inspection (Fernández et al., 2010).
planar_draw Workflow:
- Pre-process graphs in edge-list to generate one or all embeddings.
- Fundamental polygon cutting: identify $2g$ non-contractible cycles sharing a center, cut to produce a $4g$-gon.
- Coordinate assignment and quality control:
- Triangulate faces (Delgado-Friedrichs),
- Apply Tutte’s barycentric embedding with fixed polygon boundary,
- Spring-embedder refinement,
- Accept/retry based on minimal separation constraints.
- Polygon and cycle rendering: boundaries as arcs or straight lines, color or text-label matching sides, annotate cycle crossings.
- Customization: options to dictate face/edge centers, forbid certain edge-cuts, color by degree, and parameter tuning in TikZ header.
- TikZ Output for LaTeX document inclusion (Brinkmann, 2 May 2025).
5. Strategy Languages and Rule Application
GraphPaper/TULIP provides a strategy DSL for rewriting control, supporting constructs:
- Identity and failure,
- Targeted rule application ((subgraph, depth)),
- Sequential () and parallel () composition,
- Iteration (),
- Choice ( or ).
Helpers include Interface(sub) (the set of free ports) and Successors(sub) (union of subgraph and neighbors). The DSL is used to encode complex strategies such as
which specifies a prioritized rule application at the interface, followed by exhaustive application of a cleaning rule (Fernández et al., 2010).
planar_draw does not itself implement rewriting or rule computation; it is a rendering system parameterized by combinatorial and geometric options.
6. Integration, Output, and Downstream Applications
GraphPaper exports system data (graphs/rules/strategies) to TULIP, which is extended by a dedicated port/rewrite plugin implementing pattern-matching (by scanning for principal-principal connections, i.e., redexes), incremental rewriting, and dynamic visual trace generation. All graph, rule, and trace state is maintained as subgraphs of a root in TULIP, providing persistent navigation and inspection of the entire computational history (Fernández et al., 2010).
planar_draw produces TikZ code for embedding in LaTeX documents, supporting adjustment of style parameters and explicit annotation of combinatorial structures: colored or labeled polygon sides, colored vertices by degree, and annotated boundary crossings of non-contractible cycles. Preprocessing and embedding steps are chainable via Unix pipelines with companion programs (Brinkmann, 2 May 2025).
| Feature | GraphPaper/TULIP | planar_draw (“GraphPaper Editor”) |
|---|---|---|
| Output | System for interactive computation, rewrite trace, visual debugging | TikZ LaTeX source of map or embedding |
| Extension/Integration | TULIP plugin (rewriting, layout, trace) | Third-party embedding tools plus TikZ post-processing |
| Typical Use-Cases | Interaction net system development, symbolic graph rewriting, protocol/algorithm prototyping | Visualization of embeddings/maps on surfaces, publication-quality figures |
7. Context and Significance
Both GraphPaper and planar_draw embody principled approaches to graph editing and visualization in mathematically rigorous settings:
- GraphPaper/TULIP advances the specification and execution of interaction net based computations, supporting both direct manipulation and controlled strategic rewriting in a strongly confluent, local setting suitable for algorithmic exploration and correctness analysis (Fernández et al., 2010).
- planar_draw extends the capacity of researchers to visualize and document combinatorial maps on arbitrary orientable surfaces, preserving both combinatorial and topological information in a publication-ready format while allowing explicit geometric customization and encoding (Brinkmann, 2 May 2025).
A plausible implication is that these editors facilitate the bridging of abstract formal models with concrete computational and visual workflows, supporting both teaching and research in domains that require explicit, accurate graph encoding and transformation.