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

Documentation on Building a StaticGraph #20

Open
bhgomes opened this issue Apr 26, 2019 · 4 comments
Open

Documentation on Building a StaticGraph #20

bhgomes opened this issue Apr 26, 2019 · 4 comments

Comments

@bhgomes
Copy link

bhgomes commented Apr 26, 2019

I would love documentation on how to build a StaticGraph from scratch. The constructor is quite intimidating.

@sbromberger
Copy link
Contributor

You can create a StaticGraph from a SimpleGraph - that's probably the easiest way. Otherwise, you can pass a sorted vector of tuples representing edges.

But you might want to reconsider whether you need staticgraphs in the first place. They're more performant for very large (that is, several-billion-edge) graphs and won't give you much more speed for smaller graphs.

@bhgomes
Copy link
Author

bhgomes commented Apr 26, 2019

But that is exactly my use case. I have very large objects I want to turn into graphs for persistent storage. It doesn't make sense for me to build a graph as I go and then transfer into a static graph, unless the conversion is trivial.

@bhgomes
Copy link
Author

bhgomes commented Apr 26, 2019

But either way, I believe it would make your project more useful and approachable if there was at least some documentation. I had to read the source to understand the API.

@sbromberger
Copy link
Contributor

I have very large objects I want to turn into graphs for persistent storage

You don't need staticgraphs for that. The use case for staticgraphs is when you're doing graph analytics on large graph structures that have no associated metadata. The underlying StaticGraphs datastore is optimized to take advantage of CPU cache locality. If all you're doing is saving the graph, this won't help you - in fact, it might make things worse since the persistence format for staticgraphs is a non-human-readable binary format, which would require you to write a custom reader in the event you needed to import the graph structure in a non-staticgraphs environment.

Note that if you need to save any metadata (vertex or edge data) with the graph, this is not the right graph type (look at MetaGraphs for that).

It doesn't make sense for me to build a graph as I go and then transfer into a static graph, unless the conversion is trivial.

Depends on your version of trivial, I guess. At a minimum any graph in any format is defined by a list of edges. That's one of the StaticGraphs constructors (as long as that list is sorted).

I believe it would make your project more useful and approachable if there was at least some documentation.

Point taken. As this was written for a specific project at work, I didn't bother with documentation. I suppose it's worthwhile to put some basics up.

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

2 participants