Layouts are intended to be a fuzzy description of connected elements in a design. As every element should be placed exactly once, only a tree per connected elements is required. To have potentially the full control, unfinished assemblies can be provided which will be resolved through something like breadth-first search.
Layouts are intended to be a fuzzy description of connected elements in a design. As every element should be placed exactly once, only a tree per connected elements is required. To have potentially the full control, unfinished assemblies can be provided which will be resolved through something like breadth-first search.
Conceptually to achieve this:
An algorithm could be this:
Undirected graphs:
Result would be:
Directed multi graphs;
Idea use networkx as graph engine for finding subcomponents of the graph, do breadth-first search on them, etc