-
Notifications
You must be signed in to change notification settings - Fork 22
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
Some problem with atypical graph #125
Comments
Hi, I believe your situation is similar to #123 -- You want to have a certain number of nodes regardless of whether they are connected. You can use the same trick I mentioned in that issue -- adding a let g: DirectedCsrGraph<u32> = GraphBuilder::new()
.edges(vec![(12, 9), (11, 6), (5, 4), (12, 7)])
.node_values(vec![(); 15]) // <<== add a Vec<()> of size `node_count`
.build();
assert_eq!(g.node_count(), 15); |
Thanks @Paulo-21 for opening the issue and thanks @knutwalker for sharing the workaround. Let's add a |
Yes, sounds like a great idea |
Yes ty, i have seen this issue and it work fine for me
Perhaps knowing the total number of nodes before building the graph could increase the speed of graph creation because we don't have to reallocate memory when we encounter a node with an id higher up in the list of edges ? |
Hello,
I have some trouble with your librairy with graph like this one :
As you can see some nodes exist but aren't linked to any nodes.
I can't add them to the graph by the edges() function.
I'm also try to compute the page rank of this graph.
Is there is a trick i can do like when a node is alone it has always the same ranking or something, so that i don't have to had it it the graph ?
Or can we find a solution about that ?
Thank you
The text was updated successfully, but these errors were encountered: