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

Improve ViewStrings/TrueMethods for tournaments/cycle digraphs #447

Merged

Conversation

wilfwilson
Copy link
Collaborator

  • Some properties were set to be true in the CycleDigraph creation function that should rather be TrueMethods for all things satisfying IsCycleDigraph.
  • Strongly connected tournaments are Hamiltonian.
  • Stop the ViewString '<(im)mutable cycle tournament with 3 vertices>' from happening: I think <(im)mutable cycle digraph with 3 vertices> is already specific enough, I think.
  • Test the number of edges in IsCycleDigraph before testing strong connectivity, as it should be the cheaper test.

@wilfwilson wilfwilson added enhancement A label for PRs that provide enhancements. minor A label for PRs or issues that are minor in some sense. performance A label for issues or PR related to performance merge-in-to-master A label for PRs that should be merged into the master branch labels Mar 19, 2021
@@ -554,7 +554,8 @@ function(D)
Append(str, "multi");
fi;

if HasIsTournament(D) and IsTournament(D) and n > 1 then
if not (HasIsCycleDigraph(D) and IsCycleDigraph(D))
Copy link
Member

Choose a reason for hiding this comment

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

What's the overlap between being a tournament and being a cycle, some corner case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, a corner case. The only overlap is that a cycle digraph with three vertices is a tournament (although not all tournaments with three vertices are cycle digraphs).

This bit of code stops <(im)mutable cycle tournament with 3 vertices> from showing, in favour of the simpler <(im)mutable cycle digraph with 3 vertices>, in this case.

@wilfwilson wilfwilson force-pushed the cycle-digraphs-and-tournaments branch from a8b6493 to a86f46f Compare March 22, 2021 10:47
@wilfwilson wilfwilson force-pushed the cycle-digraphs-and-tournaments branch from a86f46f to e883487 Compare March 22, 2021 12:26
Copy link
Collaborator

@flsmith flsmith left a comment

Choose a reason for hiding this comment

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

Looks good.

I did think about what other properties could be set for cycle digraphs, but the answer seems to be basically all of them, which we probably don't want to do.

@wilfwilson
Copy link
Collaborator Author

As far as I'm concerned, the more the merrier 🙂 But people who might want to do that can do it in a separate PR.

@wilfwilson wilfwilson merged commit 85ab060 into digraphs:master Mar 26, 2021
@wilfwilson wilfwilson deleted the cycle-digraphs-and-tournaments branch March 26, 2021 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A label for PRs that provide enhancements. merge-in-to-master A label for PRs that should be merged into the master branch minor A label for PRs or issues that are minor in some sense. performance A label for issues or PR related to performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants