MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / check_cyclic

Method check_cyclic

graph.py:1563–1571  ·  view source on GitHub ↗
(self, points: list[Point])

Source from the content-addressed store, hash-verified

1561 return add
1562
1563 def check_cyclic(self, points: list[Point]) -> bool:
1564 points = list(set(points))
1565 if len(points) < 4:
1566 return True
1567 circle2count = defaultdict(lambda: 0)
1568 for p in points:
1569 for c in p.neighbors(Circle):
1570 circle2count[c] += 1
1571 return any([count == len(points) for _, count in circle2count.items()])
1572
1573 def make_equal_pairs(
1574 self,

Callers 5

checkMethod · 0.95
cyclic_depMethod · 0.95
add_cyclicMethod · 0.95

Calls 1

neighborsMethod · 0.80

Tested by 1