Keywords: Gabriel graph.svg Gabriel graph of 100 random points own David Eppstein 2010-05-06 Source code This image was created with the following Python source code and then recolored and converted to SVG in Adobe Illustrator <source lang python > from pyx import canvas path color from math import from random import seed random seed 12345 npoints 100 radius 0 05 exclusion 0 2 prevent points from being too close scale 5 def dist2 p q return p0-q0 2 + p1-q1 2 points while len points < 100 p random scale random scale if points nn min dist2 p q 0 5 for q in points if nn < exclusion continue points append p def neighbors p q c p0+q0 /2 p1+q1 /2 dd dist2 p c for r in points if r p and r q and dist2 r c < dd return False return True c canvas canvas def edge p q c stroke path line p0 p1 q0 q1 color rgb black def point p c fill path circle p0 p1 radius color rgb red for p in points for q in points if p < q and neighbors p q edge p q for p in points point p c writePDFfile Gabriel_graph </source> Computational geometry Files by User David Eppstein from en wikipedia Images with Python source code |