Plot graph to graph.png in canonize_and_save_graph after setting planar positions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import random
|
||||
from typing import Any, TypedDict
|
||||
from sage.all import Graph, graphs # type: ignore[attr-defined] # pylint: disable=no-name-in-module
|
||||
from lib.colored_graphs import canonize_and_save_graph
|
||||
|
||||
|
||||
class DeeplyEmbeddedGraph(TypedDict):
|
||||
@@ -63,3 +64,9 @@ def generate_example(n: int) -> DeeplyEmbeddedGraph:
|
||||
outer_cycle = [u for u, v in random.choice(faces)]
|
||||
plane_depth_labelling = get_plane_depth_labelling(g, outer_cycle)
|
||||
return DeeplyEmbeddedGraph(graph=g, outer_cycle=outer_cycle, plane_depth_labelling=plane_depth_labelling, deep_embedding=deep_embedding(g, outer_cycle, plane_depth_labelling))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
example = generate_example(10)
|
||||
canonical = canonize_and_save_graph(example['graph'])
|
||||
print(canonical)
|
||||
|
||||
Reference in New Issue
Block a user