Global Rigidity¶
This module provides algorithms related to global rigidity.
- pyrigi.graph._rigidity.global_.is_globally_rigid(graph, dim=2, algorithm='default', prob=0.0001)[source]¶
Return whether the graph is globally
dim-rigid.Definitions
- Parameters:
graph (
Graph)dim (
int) – Dimension.algorithm (
str) –If
"graphic"(only ifdim=1), then 2-connectivity is checked.If
"redundancy"(only ifdim=2), then Theorem 5 is used.If
"randomized", a probabilistic check is performed. It may give false negatives (with probability at mostprob), but no false positives. See Theorem 9.If
"default", then"graphic"is used fordim=1,"redundancy"fordim=2, and"randomized"fordim>=3.prob (
float) – Only relevant ifalgorithm="randomized". It determines the bound on the probability of the randomized algorithm to yield false negatives.
- Return type:
Examples
>>> G = Graph([(0,1), (1,2), (2,0)]) >>> is_globally_rigid(G) True >>> import pyrigi.graphDB as graphs >>> J = graphs.ThreePrism() >>> is_globally_rigid(J, dim=3) False >>> is_globally_rigid(J) False >>> K = graphs.Complete(6) >>> is_globally_rigid(K) True >>> is_globally_rigid(K, dim=3) True >>> C = graphs.CompleteMinusOne(5) >>> is_globally_rigid(C) True >>> is_globally_rigid(C, dim=3) False
- pyrigi.graph._rigidity.global_.is_weakly_globally_linked(graph, u, v, dim=2)[source]¶
Return whether the vertices
uandvare weakly globallydim-linked.Theorem 11 is used for the check.
Definitions
- Parameters:
- Return type:
Examples
>>> G = Graph([[0,4],[0,6],[0,7],[1,3],[1,6],[1,7],[2,6],[2,7],[3,5],[4,5],[4,7],[5,6],[5,7],[6,7]]) >>> is_weakly_globally_linked(G, 0,1) True >>> is_weakly_globally_linked(G, 1,5) True >>> import pyrigi.graphDB as graphs >>> G = graphs.Complete(10) >>> is_weakly_globally_linked(G, 0,1) True
The following example is Figure 1 of the article [JV24]
>>> G = Graph([[0,1],[0,2],[0,4],[1,2],[1,4],[2,3],[3,4]]) >>> is_weakly_globally_linked(G, 2,4) True