Skip to content

Fixed randomly failing test in bigraphical hyperplane function #39432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/sage/geometry/hyperplane_arrangement/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,27 @@ def bigraphical(self, G, A=None, K=QQ, names=None):
sage: HA = hyperplane_arrangements.bigraphical(G, A)
sage: HA.n_regions()
63
sage: hyperplane_arrangements.bigraphical(G, 'generic').n_regions()
sage: hyperplane_arrangements.bigraphical(G, # random
....: 'generic').n_regions()
65
sage: hyperplane_arrangements.bigraphical(G).n_regions()
59

REFERENCES:

- [HP2016]_

TESTS:

One of the above examples was marked "# random" because the output is
not always the same. However, the answer is "65" more than 99.9% of the
time, so we can make a doctest by running it repeatedly
(see :issue:`39167`). ::

sage: G = graphs.CycleGraph(4)
sage: any(hyperplane_arrangements.bigraphical(G,
....: 'generic').n_regions() == 65 for _ in range(5))
True
"""
n = G.num_verts()
if A is None: # default to G-semiorder arrangement
Expand Down