11
$\begingroup$

Bug introduced in 10.0.0 and fixed in 10.0.2


Please try to evaluate this code in Mathematica 10.

<< ComputationalGeometry`
g = RandomGraph[{12, 18}];
pt = GraphEmbedding[g];
convexhull = ConvexHull[pt];
Show[PlanarGraphPlot[pt, convexhull, ColorOutput -> Red], g,
Graphics[{Red, PointSize@Large, Point[#]} & /@ pt]]

enter image description here

Works perfectly fine on the version 9. What is this dynamic object showing up? Anybody got some explanation for this.

$\endgroup$
5
  • 1
    $\begingroup$ The graph doesn't have a layout. In this case it gets shown like a summary box. Why it doesn't have a layout I don't know. If you remove the ; after RandomGraph[...] so it gets a chance to be shown alone first, it'll work. This smells like a bug, can you please report it to support at wolfram.com? $\endgroup$
    – Szabolcs
    Commented Jul 29, 2014 at 15:33
  • 1
    $\begingroup$ Here's a minimal example: g = RandomGraph[{10, 20}]; GraphEmbedding[g]; g. $\endgroup$
    – Szabolcs
    Commented Jul 29, 2014 at 15:34
  • $\begingroup$ I shouldn't have said that it doesn't have a layout as the layout obviously gets computed by GraphEmbedding, what I meant is that the display of the graph looks the same as that of RandomGraph[{10, 20}, GraphLayout -> None]. $\endgroup$
    – Szabolcs
    Commented Jul 29, 2014 at 15:36
  • $\begingroup$ Still there in 10.0.1 $\endgroup$ Commented Sep 17, 2014 at 15:49
  • $\begingroup$ @SjoerdC.deVries Not a good news for us then :( Hope some other buggy things are repaired, that came along with the long awaited V 10. $\endgroup$ Commented Sep 17, 2014 at 15:52

3 Answers 3

8
$\begingroup$

Edit

As commented by Szabolcs, this problem occurs as a result of preventing the rendering of the Graph by adding a semi-colon to the end of the RandomGraph expression. This is obviously a bug.

Using the built-in ConvexHullMesh and allowing the graph to render:

g = RandomGraph[{12, 18}]
pt = GraphEmbedding[g];
chull = ConvexHullMesh[pt];

Then:

Show[HighlightMesh[chull, Style[1, Thin, Green]], g, Graphics[{Red, PointSize@Large, Point[pt]}]]

Mathematica graphics

$\endgroup$
9
  • $\begingroup$ This does not seem to solve OP's problem in version 10 on my machine. $\endgroup$
    – Silvia
    Commented Jul 29, 2014 at 18:50
  • $\begingroup$ @Silvia, Well, I'm on Windows 8.1 and it works just fine as my answer shows. $\endgroup$
    – RunnyKine
    Commented Jul 29, 2014 at 18:55
  • $\begingroup$ I'm on win8.1 x64 and mma 10.0 too... Now this is really getting strange... $\endgroup$
    – Silvia
    Commented Jul 29, 2014 at 18:57
  • $\begingroup$ @Silvia, you're right. It seems like the bug occurs if you put the semi-colon after the RandomGraph expression. $\endgroup$
    – RunnyKine
    Commented Jul 29, 2014 at 19:12
  • $\begingroup$ Agree this is a bug (and a weird one).. $\endgroup$
    – Silvia
    Commented Jul 29, 2014 at 19:15
6
$\begingroup$

Inspired by Szabolcs's comment, I found adding following line after g = RandomGraph[{12, 18}]; will make things right on my 10.0:

PrintTemporary[g];

Or

CopyToClipboard[g];

I guess any command that makes the FrontEnd rendering g.

$\endgroup$
2
  • 2
    $\begingroup$ other workaround: Show[g = RandomGraph[{12, 18}]]; pt = GraphEmbedding[g]; g $\endgroup$
    – halmir
    Commented Jul 29, 2014 at 19:02
  • $\begingroup$ @halmir Why I didn't think of that! :) $\endgroup$
    – Silvia
    Commented Jul 29, 2014 at 19:18
2
$\begingroup$

Fixed in 10.0.2. On windows 7, 64 bit

<< ComputationalGeometry`
g = RandomGraph[{12, 18}];
pt = GraphEmbedding[g];
convexhull = ConvexHull[pt];
Show[PlanarGraphPlot[pt, convexhull, ColorOutput -> Red], g, 
   Graphics[{Red, PointSize@Large, Point[#]} & /@ pt]]

Mathematica graphics

g = RandomGraph[{10, 20}]; GraphEmbedding[g]; g

Mathematica graphics

$\endgroup$

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.