Given a simple graph like
g=Graph[{b -> c, a -> b}]
I would like to have f[g] resulting in {a,b,c} but for instance
VertexList[g] results {b,c,a} which's not wanted.
Is there any simple way to do this?
|
Given a simple graph like
I would like to have |
||||
|
If you have disordered graph
Use sort to find the order
If your graph is directed and acyclic, then you have a built in function to sort based on topological order:
|
|||||
|
Read the FAQs! 3) When you see good Q&A, vote them up byclicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. ALSO, remember to accept the answer, if any, that solves your problem,by clicking the checkmark sign` – Vitaliy Kaurov Dec 2 '12 at 5:47