Bug introduced in 8.0.0 and fixed in 9.0.0

I am having a strange issue with PathGraph. Executing

PathGraph[{a, b, c}]

or PathGraph[{1,2,3}], etc., returns a path-graph with three vertices as expected. However, executing:

In[10]:= PathGraph[{v1, v2, v3}]
Out[10]= PathGraph[{v1, v2, v3}]

That is, it stays unevaluated instead of returning the Graph object. I tried several variations and apparently the issue occurs whenever v2 is among the vertices. That is all of PathGraph[{a1, v2, a3}], PathGraph[{v2, x}], PathGraph[{1, 2, v2, x}], etc. remain unevaluated after execution.

I tried this on two computers, both with clean Kernels (with no definitions made or packages loaded, etc.).

Mathematica version:

Can anyone reproduce this? Is this a bug?

  • 1
    $\begingroup$ I can repro this one. Awful. $\endgroup$ Commented Jun 3, 2012 at 4:59
  • $\begingroup$ Me too. Also, neither of these work either: PathGraph[{j, k, l}]; PathGraph[{v, w, x}] $\endgroup$
    – Jagra
    Commented Jun 3, 2012 at 5:07
  • 2
    $\begingroup$ Daniel Lichtblau has, on several occasions, commented/answered saying that such bugs are often caused by some internal variable sorting or issues with hashing. There is no way to predict which ones will fail, but they fix them as they find them. Here's a rather nasty bug on versions 7 and below (fixed in 8 onwards) that's somewhat related. I'd suggest emailing to [email protected] $\endgroup$
    – rm -rf
    Commented Jun 3, 2012 at 5:21
  • 1
    $\begingroup$ I emailed them. Waiting for reply. $\endgroup$
    – a06e
    Commented Jun 3, 2012 at 16:10
  • $\begingroup$ @becko Please share the reply when you get one. $\endgroup$
    – Szabolcs
    Commented Jun 4, 2012 at 7:19

1 Answer 1


This is definitely a bug. I emailed Wolfram support and got the following reply:


Thank you for your email.

I have reproduced this problem. It seems that PathGraph doesn't like variable names like v2, x, and l, but generally works for other variable names. I have filed a report with our developers on this issue. Your contact information has been added to the report so that you can be notified when this problem is resolved.

If I hear any intermediate feedback from the developers, I will be sure to pass it on to you. Right now, but guess is that there is some sort of collision between the variable names and some internal variable that is causing the problem. Therefore, the only real solution (beyond just avoiding those variable names) is to change the built in function definition.


Technical Support Wolfram Research, Inc. http://support.wolfram.com

  • $\begingroup$ This is now fixed in version 9. I'll include an edit in the question if you don't mind. $\endgroup$
    – Szabolcs
    Commented Dec 3, 2012 at 0:30

Your Answer

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

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