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

Implement LexUP and LexDOWN #28195

Closed
giorgosgiapis opened this issue Jul 14, 2019 · 37 comments
Closed

Implement LexUP and LexDOWN #28195

giorgosgiapis opened this issue Jul 14, 2019 · 37 comments

Comments

@giorgosgiapis
Copy link
Contributor

Just like in #27928 we continue with the efficient implementation of graph traversal algorithms in Cython. More information about these algorithms and how they work can be found here: https://arxiv.org/pdf/1701.00305.pdf

Depends on #27928

Component: graph theory

Keywords: gsoc19

Author: Georgios Giapitzakis Tzintanos

Branch/Commit: u/gh-giorgosgiapis/more_traversals @ a110585

Reviewer: David Coudert

Issue created by migration from https://trac.sagemath.org/ticket/28195

@giorgosgiapis
Copy link
Contributor Author

Branch: u/gh-giorgosgiapis/more_traversals

@giorgosgiapis
Copy link
Contributor Author

Commit: e15a4c6

@giorgosgiapis
Copy link
Contributor Author

Last 10 new commits:

df8e94cAdded newline at EOF
2ae8148trac #27928: Merged with 8.9.beta1
a35d7e3trac #27928: reviewer edit
5997ed0trac #27928: correct copyright
8a8e739trac #27928: missing doctests in lex BFS
9f39c33Fixed issue with documentation
17a7844Added tests and fixed typo
6593331Fixed doctests
fe62167Added LexUP
e15a4c6Added LexUP traversal

@giorgosgiapis
Copy link
Contributor Author

comment:4

Should I create a Metaticket about all the newly implemented graph traversal methods?

@dcoudert
Copy link
Contributor

comment:5

No need for a meta-ticket, but I guess you have to write a somehow a blog for reporting to GSoC.

Please add a desciption a what is lexUP. UP is not enough to guess what it can be.

@giorgosgiapis
Copy link
Contributor Author

comment:6

I will add a more detailed explanation and a reference to the paper presented in the ticket description under ALGORITHM description. I think this should be enough.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 17, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

08b55aaAdded proper description for LexUP
42266b4Revert "Added proper description for LexUP"

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 17, 2019

Changed commit from e15a4c6 to 42266b4

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 17, 2019

Changed commit from 42266b4 to e8653df

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 17, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

e8653dfAdded description and reference for LexUP

@giorgosgiapis
Copy link
Contributor Author

comment:9

I can't build the documentation after I modified src/doc/en/reference/references/index.rst. I am getting lots of "Citation not found" errors when running docbuild. Should I run make doc-clean && make?

@dcoudert
Copy link
Contributor

comment:10

Yes. The system is far from perfect when you touch the references...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 19, 2019

Changed commit from e8653df to acaaf6f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 19, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

acaaf6fAdded Lex Down traversal

@giorgosgiapis
Copy link
Contributor Author

comment:12

I have added Lex Down traversal. I will try running make doc-clean && make once again to see if it will build the documentation.

@giorgosgiapis
Copy link
Contributor Author

comment:13

Documentation just finished building. Everything seems fine with the way html is displayed.

@dcoudert
Copy link
Contributor

comment:14

Please use UP and DOWN everywhere in method names.

in traversals.pyx

-    :meth:`~lex_Up` | Perform a lexicographic up (LexUp) on the graph.
+    :meth:`~lex_UP` | Perform a lexicographic UP search (LexUP) on the graph.
  • you have not added an alias for lex_DOWN in generic_graph.py

  • unify the one line description for Lex_DOWN everywhere. The work search is missing, etc.

  • you can add a SEEALSO block with links to Lex_BFS, Lex_DFS, etc.

@dcoudert
Copy link
Contributor

Reviewer: David Coudert

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 22, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

9836457fixed typos and added alias for lex_DOWN in generic_graph.py
5bb3dd9Added SEEALSO blocks

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 22, 2019

Changed commit from acaaf6f to 5bb3dd9

@dcoudert
Copy link
Contributor

comment:17

Why are you referring to lex BFS in lex UP and to lex DFS in lex DOWN ? Are these methods closer ? Otherwise, why not referring to all other methods ?

@dcoudert
Copy link
Contributor

comment:18

and you can also add a link to :wikipedia:`Lexicographic_breadth-first_search` in lex BFS.

@giorgosgiapis
Copy link
Contributor Author

comment:19

Replying to @dcoudert:

Why are you referring to lex BFS in lex UP and to lex DFS in lex DOWN ? Are these methods closer ? Otherwise, why not referring to all other methods ?

I think they are closer since in both lex BFS and lex UP we append to the labels of nodes while in lex DFS and lex DOWN we prepend.

@giorgosgiapis
Copy link
Contributor Author

comment:20

Replying to @dcoudert:

and you can also add a link to :wikipedia:`Lexicographic_breadth-first_search` in lex BFS.

Will do.

@dcoudert
Copy link
Contributor

comment:21

I think they are closer since in both lex BFS and lex UP we append to the labels of nodes while in lex DFS and lex DOWN we prepend.

Good point. I admit that It's not easy to understand what these traversals do (the order to expect) and for what usage they are useful.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 23, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

f27f600Added wikipedia reference for lex_BFS

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 23, 2019

Changed commit from 5bb3dd9 to f27f600

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 28, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

550b376Fixed typo in comment

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 28, 2019

Changed commit from f27f600 to 550b376

@dcoudert
Copy link
Contributor

comment:24

May be we could add an example showing that the resulting orderings are different. For instance:

sage: G = digraphs.DeBruijn(2,3)
sage: G.lex_BFS(initial_vertex='000')
['000', '001', '100', '010', '011', '110', '101', '111']
sage: G.lex_DFS(initial_vertex='000')
['000', '001', '100', '010', '101', '110', '011', '111']
sage: G.lex_UP(initial_vertex='000')
['000', '001', '010', '101', '110', '111', '011', '100']
sage: G.lex_DOWN(initial_vertex='000')
['000', '001', '100', '011', '010', '110', '111', '101']

@giorgosgiapis
Copy link
Contributor Author

comment:25

Replying to @dcoudert:

May be we could add an example showing that the resulting orderings are different. For instance:

sage: G = digraphs.DeBruijn(2,3)
sage: G.lex_BFS(initial_vertex='000')
['000', '001', '100', '010', '011', '110', '101', '111']
sage: G.lex_DFS(initial_vertex='000')
['000', '001', '100', '010', '101', '110', '011', '111']
sage: G.lex_UP(initial_vertex='000')
['000', '001', '010', '101', '110', '111', '011', '100']
sage: G.lex_DOWN(initial_vertex='000')
['000', '001', '100', '011', '010', '110', '111', '101']

Good idea! Should I add it to all methods?

@dcoudert
Copy link
Contributor

comment:26

it's certainly better.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 31, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

a110585Added doctests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 31, 2019

Changed commit from 550b376 to a110585

@dcoudert
Copy link
Contributor

comment:28

If it's in the tests block, it's true that there is no need for adding these examples in all methods.
One alternative is to put the examples in the examples block of lex_BFS and to remove it from other methods. Sorry for the extra work.

@giorgosgiapis
Copy link
Contributor Author

comment:29

Currently, this test is in the examples block of all methods. Maybe we should leave it that way (I don't think it is bad to have the same example in several methods). If it is better I can remove it from other methods

@dcoudert
Copy link
Contributor

dcoudert commented Aug 1, 2019

comment:30

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants