1
$\begingroup$

With the function Graph and the option GraphLayout --> "CircularEmbedding", i manage to obtain the graph drawn in the way i want. But, the vertex are given not in the order I want. How i can change the direction of travel of the vertex in a circular Graph ? Of course, i can change the order of the list given in argument. But, if there is an option to direcly change the direction of travel i would be interested. Thank you in advance for your help

$\endgroup$
1
$\begingroup$

In older versions of Mathematica, "CircularEmbedding" used the graph's own vertex ordering to place vertices along the circle.

In more recent versions (I don't recall which, perhaps 12.1?), the layout is optimized to reduce the number of edge crossings. To restore the old behaviour, use

GraphLayout -> {"CircularEmbedding", "OptimalOrder" -> False}

This is in the documentation.

Alternatively, use IGLayoutCircle from my IGraph/M package.

IGraph/M also has a function to easily reorder the vertices of a graph while retaining all graph properties: IGReorderVertices[yourPreferredOrder, graph]. This makes it easy to control the ordering.

$\endgroup$
2
  • $\begingroup$ thank you for your feedback. Is your package IGraph/M package avalable ? and if yes, where can it be possible to download it ? $\endgroup$
    – Bendesarts
    May 30 at 11:27
  • $\begingroup$ @Bendesarts Have you tried googling for it? If yes, and you did not find it, I would like to know what exactly you searched for and what search engine (or what specific country/version of Google) you used. $\endgroup$
    – Szabolcs
    May 30 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.