AlgebraicJulia / AlgebraicPetri.jl

Build Petri net models compositionally
https://algebraicjulia.github.io/AlgebraicPetri.jl/
MIT License
74 stars 20 forks source link

Use color to distinguish morphisms of Petri nets #170

Open slwu89 opened 6 months ago

slwu89 commented 6 months ago

When looking at morphisms $\phi: P \to P{type}$ its often the case that $P{type}$ will only have a small number of transitions and places. In that case, it would be nice to use color to visualize the data of the morphism, rather than edges, which do rather strange things with the graph placement algorithm and get somewhat unreadable for even moderately sized petri nets (see ex from docs):

plot_37

slwu89 commented 6 months ago

Also, in large PNs it becomes rather hard to see what is going on. I wonder if adding invisible edges (like is done to ease bipartite graph viz in Catlab) between transitions of the same type in the domain PN would help the graph placement algorithm produce more readable graphs?

I also am not sure if graphviz provides a way to put strict bounds on the ratio of size between the largest and smallest shapes used to draw nodes, for example. In the above plot, the type Petri net is almost indistinguishable.

slwu89 commented 6 months ago

Could look at the header of https://github.com/AlgebraicJulia/Structured-Epidemic-Modeling/blob/main/stratification.ipynb