1

I'm dealing with structures where there is a poset and an extra undirected graph on the same vertices which is a subgraph of the poset's incomparability graph. In my physical notebook I draw the hasse diagram of the poset and add the extra graph's edges in a different color. Can I do something like that in sage?

acupoftea
  • 181
  • 2
  • 11
  • Not a sage user, but perhaps you could represent both structures in a single `multigraph` as described [here](https://doc.sagemath.org/html/en/reference/graphs/sage/graphs/graph.html); you can then keep track of different edge colors using something like [this](https://stackoverflow.com/questions/25639169/networkx-change-color-width-according-to-edge-attributes-inconsistent-result). – hilberts_drinking_problem Oct 28 '20 at 01:40
  • @hilberts_drinking_problem yeah I can do differently colored edges but if I do it as a general (multi)graph then it won't show the hasse diagram nicely leveled – acupoftea Oct 28 '20 at 01:49
  • I suppose you could specify node coordinates manually (as in [here](https://stackoverflow.com/questions/30689391/how-to-reshape-a-networkx-graph-in-python)), but it does sound like a bit of work. Maybe someone with sage experience will know a better way. – hilberts_drinking_problem Oct 28 '20 at 01:54
  • @hilberts_drinking_problem this way I can't use the poset drawing from sage right? – acupoftea Nov 02 '20 at 06:06

0 Answers0