Skip to content
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

Add GeneralisedPetersenGraph function #204

Merged
merged 4 commits into from
Jun 21, 2019

Conversation

MTWhyte
Copy link
Collaborator

@MTWhyte MTWhyte commented Jun 14, 2019

This pull requests adds the Generalised Petersen Graphs to the standard examples, using the construction as described here.

@james-d-mitchell james-d-mitchell added the new-feature A label for new features. label Jun 14, 2019
Copy link
Member

@james-d-mitchell james-d-mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor quibbles.

doc/exmpl.xml Outdated

For more information, see <URL>https://en.wikipedia.org/wiki/Generalized_Petersen_graph</URL><P/>

See also <Ref Func="DigraphsTestInstall"/>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we see also DigraphsTestInstall??

doc/exmpl.xml Outdated
<#GAPDoc Label="GeneralisedPetersenGraph">
<ManSection>
<Attr Name="GeneralisedPetersenGraph" Arg="n, k"/>
<Returns>A digaph.</Returns>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

digaph -> digraph

<immutable digraph with 10 vertices, 30 edges>
gap> IsIsomorphicDigraph(D, PetersenGraph());
true
]]></Example>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add an example which returns a mutable digraph? Other manual examples don't do this only because they haven't yet been updated.

gap/exmpl.gi Outdated
if n + i + k <= 2 * n then
DigraphAddEdge(D, [n + i, n + i + k]);
else
DigraphAddEdge(D, [n + i, (n + i + k) mod n + n]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe some brackets around ((n + i + k) mod n) + n?

<immutable digraph with 10 vertices, 30 edges>
gap> IsIsomorphicDigraph(D, PetersenGraph());
true
gap> mat8_3 := [[0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make this all much shorter by just doing:

gap> G8_3 := DigraphFromGraph6String("OCQa`Q?OH?a@A@@?_OGB@");

@james-d-mitchell james-d-mitchell merged commit 8153edf into digraphs:master Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature A label for new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants