Skip to content

Allow optional reordering of node indexes #7

@tresoldi

Description

@tresoldi

Due to minimization, it is common to have "gaps" in the indexes of the nodes, as 5 and 6 in the example below:

>>> print(DAFSA(["mama", "papa", "mapa"]))
DAFSA with 7 nodes and 8 edges (3 inserted sequences)
  +-- #0: 0(#1/3:<m>/2|#7/3:<p>/1) [('m', 1), ('p', 7)]
  +-- #1: n(#2/2:<a>/2) [('a', 2)]
  +-- #2: n(#3/2:<m>/1|#3/2:<p>/1) [('m', 3), ('p', 3)]
  +-- #3: n(#4/3:<a>/3) [('a', 4)]
  +-- #4: F() []
  +-- #7: n(#8/1:<a>/1) [('a', 8)]
  +-- #8: n(#3/1:<p>/1) [('p', 3)]

Indexes are supposed to be meaningless, and reordering after minimization is computationally expensive. Still, it is worth adding a flag that carries the reordering if so specified by the user.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions