szhorvat / IGraphM

IGraph/M is the igraph interface for Mathematica
http://szhorvat.net/mathematica/IGraphM
Other
90 stars 17 forks source link

IGGabrielGraph returns non-connected graph #95

Closed szhorvat closed 4 years ago

szhorvat commented 5 years ago

IGGabrielGraph should never return a non-connected graph. In the following example it does:

SeedRandom[121]
While[True,
 g = IGGabrielGraph[pts = RandomPoint[Disk[{0, 0}, {12, 1}], 5]];
 If[Not@ConnectedGraphQ[g], Break[]]
 ]
Graph[g, VertexSize -> Small, VertexLabels -> Automatic]

The connection 2 <-> 3 is missing.

The corresponding point set is:

pts = {{-4.118578874444008`, 0.4845955432572233`}, {8.10890869514964`, 
  0.6755847677854443`}, {8.095988284791568`, 
  0.6889321601085725`}, {7.072778096907731`, 
  0.6097916727017108`}, {8.701059740206944`, -0.49426075420605997`}}