Add level edge definition to plane depth sequencing paper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 04:08:33 -04:00
parent 9107a72e0c
commit fe423dc7ba
7 changed files with 80 additions and 30 deletions
+3 -3
View File
@@ -53,8 +53,8 @@ def plot_colored_graph_to_data_uri(g: Graph, coloring: VertexColoring) -> str:
return f"data:image/png;base64,{base64.b64encode(png_bytes).decode()}"
def canonize_and_save_graph(g: Graph) -> Graph:
"""Canonize g, save to data/graphs/<graph_id>/graph.sobj, and return the canonical graph."""
def canonize_and_save_graph(g: Graph) -> tuple[Graph, Path]:
"""Canonize g, save to data/graphs/<graph_id>/graph.sobj, and return the canonical graph and its folder."""
canonical = cast(Graph, g.canonical_label())
graph_id = base64.urlsafe_b64encode(canonical.graph6_string().encode()).decode()
out_dir = DIR / "data" / "graphs" / graph_id
@@ -63,7 +63,7 @@ def canonize_and_save_graph(g: Graph) -> Graph:
canonical.is_planar(set_embedding=True, set_pos=True)
canonical.plot().save(out_dir / 'graph.png')
save(canonical, str(out_dir / 'graph'))
return canonical
return canonical, out_dir
def save_colored_graph(g: Graph, coloring: VertexColoring) -> tuple[Graph, VertexColoring, ColoredGraphId]: