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

Refactor Graph Reading for Consistency with DFS Tree Creation #93

Open
7 tasks
john-boyer-phd opened this issue Aug 11, 2024 · 0 comments
Open
7 tasks

Comments

@john-boyer-phd
Copy link
Collaborator

john-boyer-phd commented Aug 11, 2024

Please note: solving this issue should be done as the driver use case for issue #95.

Once upon a time in graphIO.c, the behavior of the adjacency list reader and writer were synchronized to ensure that a read followed by a write produced the same output result as the input. That synchrony must be preserved, but it has now become an issue that the adjacency list reader does not produce the adjacency nodes in the left-to-right order of the file according to the interpretation ofthe link[0] and link[1] data members that is imparted by imparted by, respectively, getFirstArc()/getNextArc() and getLastArc()/getPrevArc(). Therefore, methods like gp_CreateDFSTree() do not process the adjacency nodes in the same order that they occur in a natural reading of the input file.

The following items need to be changed to address this use case:

  • Change the link parameters in the call to gp_DynamicAddEdge() in _ReadAdjList() to cause adjacency nodes to be added in getFirstArc()/getNextArc()` traversal order.
  • In the else clause after the one containin the first invocation of gp_DynamicAddEdge() in _ReadAdjList(), amend the logic so that preexisting adjacency nodes from lower numbered vertices are also inserted in the correct location according to the getFirstArc()/getNextArc()` traversal order.
  • To maintain read/write synchrony, amend _WriteAdjList() to use getFirstArc()/getNextArc()traversal order rather than the currentgetLastArc()/getPrevArc()` traversal order.
  • Test to ensure that an adjacency list read then write produces the same output as the input.
  • Test to ensure that an adjacency list read followed by gp_CreateDFSTree(), gp_SortVertices(), and then gp_Write() produces the expected vertex re-ordering and adjacency list node neighbor field renumbering according to left-to-write file reading corresponding to getFirstArc()/getNextArc()traversal order and stack operations used bygp_CreateDFSTree()` to create depth-first indices.
  • Amend the link parameters in gp_DynamicAddEdge() invocations in other readers (adjacency matrix, LEDA, and g6) so that the natural read order of the respective file formats corresponds to the getFirstArc()/getNextArc()` traversal order.
  • Test that each amended reader is generating adjacency nodes in the correct order by performing a graph read with the reader then write to adjacency list using the planarity executable's transform feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant