{"id":33926104,"url":"https://github.com/symbolica-dev/graphica","last_synced_at":"2025-12-12T10:05:07.865Z","repository":{"id":324952027,"uuid":"1078879006","full_name":"symbolica-dev/graphica","owner":"symbolica-dev","description":"Graphica is an open-source graph crate for Rust that allows for the generation, manipulation and canonization of multi-edge graphs with mixed directed and undirected edges and arbitrary node and edge data.","archived":false,"fork":false,"pushed_at":"2025-10-18T16:12:02.000Z","size":16,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-18T20:12:31.849Z","etag":null,"topics":["canonization","graph","graph-generation"],"latest_commit_sha":null,"homepage":"https://symbolica.io","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/symbolica-dev.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-18T16:08:43.000Z","updated_at":"2025-11-18T18:06:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/symbolica-dev/graphica","commit_stats":null,"previous_names":["symbolica-dev/graphica"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/symbolica-dev/graphica","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symbolica-dev%2Fgraphica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symbolica-dev%2Fgraphica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symbolica-dev%2Fgraphica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symbolica-dev%2Fgraphica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/symbolica-dev","download_url":"https://codeload.github.com/symbolica-dev/graphica/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/symbolica-dev%2Fgraphica/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27680582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canonization","graph","graph-generation"],"created_at":"2025-12-12T10:04:30.944Z","updated_at":"2025-12-12T10:05:07.851Z","avatar_url":"https://github.com/symbolica-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graphica\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://symbolica.io\"\u003e\u003cimg alt=\"Symbolica website\" src=\"https://img.shields.io/static/v1?label=symbolica\u0026message=website\u0026color=orange\u0026style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://zulip.symbolica.io\"\u003e\u003cimg alt=\"Zulip Chat\" src=\"https://img.shields.io/static/v1?label=zulip\u0026message=discussions\u0026color=blue\u0026style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/symbolica-dev/graphica\"\u003e\u003cimg alt=\"Graphica repository\" src=\"https://img.shields.io/static/v1?label=github\u0026message=development\u0026color=green\u0026style=flat-square\u0026logo=github\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://app.codecov.io/gh/symbolica-dev/graphica\"\u003e\u003cimg alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/symbolica-dev/graphica?token=21E993U9SQ\u0026style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nGraphica is an open-source graph crate for Rust that allows for the generation, manipulation and canonization of multi-edge graphs with mixed directed and undirected edges and arbitrary node and edge data.\n\nGraphica was open sourced by Ruijl Research and is a part of [Symbolica](https://symbolica.io).\n\n# Examples\n\n### Graph generation\n\nGenerate all unique graphs with two external edges with edge data `g` and with vertices with specific edge attachments:\n\n```rust\nlet g = HalfEdge::undirected(\"g\");\nlet q = HalfEdge::incoming(\"q\");\nlet gs = Graph::\u003c_, \u0026str\u003e::generate(\n    \u0026[(1, g), (2, g)],\n    \u0026[vec![g, g, g], vec![q.flip(), q, g], vec![g, g, g, g]],\n    GenerationSettings::new()\n        .max_loops(2)\n        .max_bridges(0)\n        .allow_self_loops(true),\n)\n.unwrap();\n\nlet r = gs.keys().next().unwrap().to_mermaid();\nprintln!(\"{}\", r);\n```\nyields\n\n```mermaid\ngraph TD;\n  0[\"0\"];\n  1[\"0\"];\n  2[\"0\"];\n  3[\"1\"];\n  4[\"2\"];\n  0 ---|\"g\"| 1;\n  0 ---|\"g\"| 2;\n  0 ---|\"g\"| 3;\n  0 ---|\"g\"| 4;\n  1 --\u003e|\"q\"| 2;\n  2 --\u003e|\"q\"| 1;\n```\n\n### Graph canonization\n\nUse a modified version of McKay's graph canonization algorithm to canonize graphs and detect isomorphisms:\n\n```rust\nlet mut g = Graph::new();\nlet n0 = g.add_node(1);\nlet n1 = g.add_node(0);\nlet n2 = g.add_node(1);\nlet n3 = g.add_node(0);\nlet n4 = g.add_node(2);\nlet n5 = g.add_node(0);\nlet n6 = g.add_node(1);\nlet n7 = g.add_node(0);\nlet n8 = g.add_node(1);\n\ng.add_edge(n0, n1, false, 0).unwrap();\ng.add_edge(n0, n3, false, 0).unwrap();\ng.add_edge(n1, n2, false, 0).unwrap();\ng.add_edge(n1, n3, false, 0).unwrap();\ng.add_edge(n1, n4, false, 0).unwrap();\ng.add_edge(n1, n5, false, 0).unwrap();\ng.add_edge(n2, n5, false, 0).unwrap();\ng.add_edge(n3, n4, false, 0).unwrap();\ng.add_edge(n3, n6, false, 0).unwrap();\ng.add_edge(n3, n7, false, 0).unwrap();\ng.add_edge(n4, n5, false, 0).unwrap();\ng.add_edge(n4, n7, false, 0).unwrap();\ng.add_edge(n5, n7, false, 0).unwrap();\ng.add_edge(n5, n8, false, 0).unwrap();\ng.add_edge(n6, n7, false, 0).unwrap();\ng.add_edge(n7, n8, false, 0).unwrap();\n\nlet c = g.canonize();\n\nassert_eq!(c.orbit_generators.len(), 2);\nassert_eq!(c.automorphism_group_size, 8);\n\nprintln!(\"{}\", c.graph.to_dot());\n```\nyields canonical graph\n```mermaid\ngraph TD;\n  0[\"0\"];\n  1[\"0\"];\n  2[\"0\"];\n  3[\"0\"];\n  4[\"1\"];\n  5[\"1\"];\n  6[\"1\"];\n  7[\"1\"];\n  8[\"2\"];\n  0 ---|\"0\"| 2;\n  0 ---|\"0\"| 3;\n  0 ---|\"0\"| 6;\n  0 ---|\"0\"| 7;\n  0 ---|\"0\"| 8;\n  1 ---|\"0\"| 2;\n  1 ---|\"0\"| 3;\n  1 ---|\"0\"| 4;\n  1 ---|\"0\"| 5;\n  1 ---|\"0\"| 8;\n  2 ---|\"0\"| 5;\n  2 ---|\"0\"| 7;\n  2 ---|\"0\"| 8;\n  3 ---|\"0\"| 4;\n  3 ---|\"0\"| 6;\n  3 ---|\"0\"| 8;\n```\n\n## Development\n\nFollow the development and discussions on [Zulip](https://reform.zulipchat.com)!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymbolica-dev%2Fgraphica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsymbolica-dev%2Fgraphica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsymbolica-dev%2Fgraphica/lists"}