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

Support unmapped adjacency list indices #14

Closed
HusseinElMotayam opened this issue Mar 11, 2020 · 0 comments · Fixed by #15
Closed

Support unmapped adjacency list indices #14

HusseinElMotayam opened this issue Mar 11, 2020 · 0 comments · Fixed by #15

Comments

@HusseinElMotayam
Copy link
Contributor

There is a slight improvement that can be done based on the discussion in:
tomshanley/d3-sankey-circular#40

Suppose that the adjacency list is defined as:

var adjacencyList = [];
adjacencyList[0] = [2];
adjacencyList[2] = [0];

Iterating sequentially over that array in https://github.com/antoinerg/elementary-circuits-directed-graph/blob/master/johnson.js#L72 will throw an error when reaching index 1.

Perhaps we can do a check first and skip non-existing keys.
I'm also not sure if this will be sufficient, or if other changes need to be done somewhere else to accommodate the missing keys in the adjacency list.

HusseinElMotayam added a commit to HusseinElMotayam/elementary-circuits-directed-graph that referenced this issue Mar 11, 2020
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

Successfully merging a pull request may close this issue.

1 participant