Graph.count_crossings

Graph.count_crossings()[source]

Count the number of crossings (pairs of crossing edges) in the graph.

Parameters:
graphcompas.datastructures.Graph

A graph object.

Returns:
int

The number of crossings.

Notes

This algorithm assumes that the graph lies in the XY plane.