Storing a graph in mongodb

Specialized Distributed Graph Databases I know this is sounds a little far afield from the OPs question about Mongo, but these days there are more specialized graph databases that excel at this kind of work and may be much easier for you to use, especially on large graphs. There is a comparison of 7 such …

Read more

graph rendering in python (flowchart visualization) [closed]

Graphviz is the best option in my opinion. Graphviz is the premiere graph rendering/layout library; it’s mature, stable, open-source, and free of charge. It is not a dedicated flowchart or diagramming package, but its core use case–i.e., efficient and aesthetic rendering of objects comprised of nodes and edges, obviously subsumes flowchart drawing–particularly because its api …

Read more

Longest word chain from a list of words

You can use recursion to explore every “branch” that emerges when every possible letter containing the proper initial character is added to a running list: words = [‘giraffe’, ‘elephant’, ‘ant’, ‘tiger’, ‘racoon’, ‘cat’, ‘hedgehog’, ‘mouse’] def get_results(_start, _current, _seen): if all(c in _seen for c in words if c[0] == _start[-1]): yield _current else: for …

Read more

Modifying vertex properties in a Boost::Graph

Bundled properties are straightforward to use: using namespace boost; struct vertex_info { std::string whatever; int othervalue; std::vector<int> some_values; }; typedef adjacency_list<vecS, vecS, undirectedS, vertex_info> graph_t; graph_t g(n); g[0].whatever = “Vertex 0”; […] and so on. Please also refer to the docs. The other type of vertex property that are very useful are external properties. You …

Read more