Skip to content

minimize_space breaks runnability for patterns that are inconsistent with their graph flow #157

Description

@thierry-martinez

Describe the bug
If a pattern has a graph with a flow but is not consistent with this flow, minimize_space leads to a pattern with is not runnable anymore.

To Reproduce

import graphix
pattern = graphix.pattern.Pattern(input_nodes=[0])
pattern.add(["N", 1])
pattern.add(["N", 2])
pattern.add(["E", (0, 1)])
pattern.add(["E", (1, 2)])
pattern.add(["M", 1, "XY", 0, [], []])
pattern.add(["M", 0, "XY", 0, [1], []])
pattern.add(["Z", 2, [0]])
pattern.simulate_pattern() # OK
pattern.minimize_space()
pattern.simulate_pattern() # KeyError: 1

Expected behavior
minimize_space should preserve pattern runnability.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions