Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ src/sage/graphs/graph_decompositions/__init__.py
src/sage/graphs/generators/__init__.py
src/sage/graphs/__init__.py
src/sage/graphs/base/__init__.py
src/sage/graphs/tests/__init__.py
src/sage/databases/__init__.py
src/sage/stats/hmm/__init__.py
src/sage/stats/__init__.py
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ file_paths = [
'src/sage/graphs/generators/__init__.py',
'src/sage/graphs/__init__.py',
'src/sage/graphs/base/__init__.py',
'src/sage/graphs/tests/__init__.py',
'src/sage/databases/__init__.py',
'src/sage/stats/hmm/__init__.py',
'src/sage/stats/__init__.py',
Expand Down
1 change: 1 addition & 0 deletions src/sage/graphs/generators/smallgraphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4189,6 +4189,7 @@ def PetersenGraph():
from sage.graphs.generators.families import GeneralizedPetersenGraph
P = GeneralizedPetersenGraph(5, 2)
P.name("Petersen graph")
P.is_projective_planar.set_cache(True)
return P


Expand Down
4 changes: 3 additions & 1 deletion src/sage/graphs/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@
from sage.parallel.decorate import parallel
from sage.misc.lazy_import import lazy_import, LazyImport
from sage.features.mcqd import Mcqd
from sage.misc.cachefunc import cached_method

lazy_import('sage.graphs.mcqd', ['mcqd'],
feature=Mcqd())
Expand Down Expand Up @@ -9501,6 +9502,7 @@ def bipartite_double(self, extended=False):
G.name("%sBipartite Double of %s" % (prefix, self.name()))
return G

@cached_method
@doc_index("Graph properties")
def is_projective_planar(self, return_map=False):
r"""
Expand Down Expand Up @@ -9528,7 +9530,7 @@ def is_projective_planar(self, return_map=False):
The Petersen graph is a known projective planar graph::
sage: P = graphs.PetersenGraph()
sage: P.is_projective_planar() # long time
sage: P.is_projective_planar()
True
`K_{4,4}` has a projective plane crossing number of 2. One of the
Expand Down
2 changes: 2 additions & 0 deletions src/sage/graphs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ py.install_sources(
subdir: 'sage/graphs',
)


extension_data = {
'asteroidal_triples' : files('asteroidal_triples.pyx'),
'centrality' : files('centrality.pyx'),
Expand Down Expand Up @@ -178,3 +179,4 @@ py.extension_module(
subdir('base')
subdir('generators')
subdir('graph_decompositions')
subdir('tests')
13 changes: 13 additions & 0 deletions src/sage/graphs/tests/is_projective_planar_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import pytest


def test_petersen_graph_is_projective_planar():
r"""
Ensure that the Petersen graph is projective planar without
using the cache.
"""
from sage.graphs.generators.smallgraphs import PetersenGraph
P = PetersenGraph()
P.is_projective_planar.clear_cache()
assert not P.is_projective_planar.is_in_cache()
assert P.is_projective_planar()
5 changes: 5 additions & 0 deletions src/sage/graphs/tests/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
py.install_sources(
'__init__.py',
'is_projective_planar_test.py',
subdir: 'sage/graphs/tests',
)
Loading