diprism / fggs

Factor Graph Grammars in Python
MIT License
13 stars 3 forks source link

Ordered nodes and edges #136

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

For the Viterbi algorithm (#122) it will be convenient for an iterator over a graph's edges always to have the same order, and set() doesn't guarantee this but dict() does. So this replaces the two sets of Edges and Edge ids with a single dict mapping from Edge ids to Edges (which I like better anyway). For symmetry, the same thing is done to Nodes.