3
$\begingroup$

Why the following works only with integers and if other names of vertices are used UndirectedEdge is needed?

{Graph[{{1, 2}, {2, 3}, {3, 1}}], Graph[{{a, b}, {b, c}, {c, a}}], 
  Graph[UndirectedEdge @@@ {{a, b}, {b, c}, {c, a}}]} // Row

enter image description here

$\endgroup$
2
  • 4
    $\begingroup$ This is not a documented syntax. If you use it, you are risking that your code will break in the future. A bit of experimentation does reveal that with this syntax one must use vertex indices, not names. $\endgroup$ Commented Mar 21, 2024 at 20:05
  • 1
    $\begingroup$ related Q/As: converting list of ordered pairs to graph and Union of list with logical rules for combination $\endgroup$ Commented Mar 21, 2024 at 20:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.