graph-theory

Building or Finding a “relevant terms” suggestion feature

ⅰ亾dé卋堺 提交于 2019-12-02 18:36:09
Given a few words of input, I want to have a utility that will return a diverse set of relevant terms, phrases, or concepts. A caveat is that it would need to have a large graph of terms to begin with, or else the feature would not be very useful. For example, submitting "baseball" would return ["shortstop", "Babe Ruth", "foul ball", "steroids", ... ] Google Sets is the best example I can find of this kind of feature, but I can't use it since they have no public API (and I wont go against their TOS). Also, single-word input doesn't garner a very diverse set of results. I'm looking for a

Recording predecessors in a DFS search in an undirected graph

笑着哭i 提交于 2019-12-02 18:04:41
问题 I was trying to use the code from this thread: Boost DFS back_edge, to record the cycles in an undirected graph. To do this I need to store the predecessors for each dfs tree when it finds a back_edge. Since this is an undirected graph I think we can not use directly on_back_edge() from EventVisitor Concept. So I was thinking to record the predecessors in the void back_edge() method of below code. But I am not sure how to do this and return the cycle vertices. Here is the code and the part I

Is there any graph data structure implemented for C#

て烟熏妆下的殇ゞ 提交于 2019-12-02 17:52:15
I tried to find a graph data structure to reuse in C# without any success. Of course, I can borrow from data structure books but I want it to be more commercially practical(?) Also I would appreciate if you can tell me what the best way of implementing a graph is. Thanks QuickGraph QuickGraph is a graph library for .NET that is inspired by Boost Graph Library. QuickGraph provides generic directed/undirected graph datastructures and algorithms for .Net 2.0 and up. QuickGraph comes with algorithms such as depth first seach, breath first search, A* search, shortest path, k-shortest path, maximum

How can I prove the “Six Degrees of Separation” concept programmatically?

て烟熏妆下的殇ゞ 提交于 2019-12-02 17:47:14
I have a database of 20 million users and connections between those people. How can I prove the concept of "Six degrees of separation" concept in the most efficient way in programming? link to the article about Six degrees of separation You just want to measure the diameter of the graph. This is exactly the metric to find out the seperation between the most-distantly-connected nodes in a graph. Lots of algorithms on Google, Boost graph too. You can probably fit the graph in memory (in the representation that each vertex knows a list of its neighbors). Then, from each vertex n , you can run a

Names of Graph Traversal Algorithms

余生颓废 提交于 2019-12-02 17:33:14
What I'm looking for is a comprehensive list of graph traversal algorithms, with brief descriptions of their purpose, as a jump off point for researching them. So far I'm aware of: Dijkstra's - single-source shortest path Kruskal's - finds a minimum spanning tree What are some other well-known ones? Please provide a brief description of each algorithm to each of your answers. the well knowns are : Depth-first search http://en.wikipedia.org/wiki/Depth-first_search Breadth-first search http://en.wikipedia.org/wiki/Breadth-first_search Prim's algorithm http://en.wikipedia.org/wiki/Prim's

What is meant by diameter of a network?

亡梦爱人 提交于 2019-12-02 16:46:17
The diagram shown on this link of the " A graph with 6 vertices and 7 edges where the vertex no 6 on the far-left is a leaf vertex or a pendant vertex. " has DIAMETER 4? right or wrong? Definitions are The diameter of a graph is the maximum eccentricity of any vertex in the graph. That is, it is the greatest distance between any pair of vertices. To find the diameter of a graph, first find the shortest path between each pair of vertices. The greatest length of any of these paths is the diameter of the graph. Diameter, D, of a network having N nodes is defined as the maximum shortest paths

What options are available for the layout of directed or undirected graphs in .NET?

丶灬走出姿态 提交于 2019-12-02 16:45:37
By graph here I mean something resembling these images: The ideal solution would: use only managed code allow output to a bitmap image allow output to WPF elements include some kind of interactive surface for displaying the graph that supports zooming, panning and reorganisation of nodes I'm also interested in hearing about projects that could potentially be used as the starting point for this kind of work. If it requires some development to achieve what I want, then I'm prepared to tackle it. The most complex portion of this goal seems to be obtaining the graph layout in a reasonable time

Multigraphs with javascript

≯℡__Kan透↙ 提交于 2019-12-02 16:21:39
First of all look at this question. None of those libraries support Multigraphs (or Pseudographs ). I mean I can't generate graphs like this: Is there any jQuery plugin (or javascript library) out there for this purpose ? I thought i can use WolframAlpha's API and use its images, something like this : but it have lots of problem: I can't move nodes or add remove edges interactively. Only 2000 API calls per month. Not enough. I can't produce large or intermediate graphs. Its really ugly ! Please help me if you know some javascript library in order to draw Multigraphs, or anyway to produce such

Difference between DFS vs BFS in this example?

岁酱吖の 提交于 2019-12-02 15:23:29
问题 I am bit confused after reading examples at DFS where output is printed in different fashion for both DFS approaches though both are said to be DFS. In fact DFS recursion approach print the output just in same fashion as BFS. Then what's the difference ? Is recursion approach given here not an example of DFS ? Using Stack // Iterative DFS using stack public void dfsUsingStack(Node node) { Stack<Node> stack=new Stack<Node>(); stack.add(node); node.visited=true; while (!stack.isEmpty()) { Node

'Head First' Style Data Structures & Algorithms Book? [closed]

一笑奈何 提交于 2019-12-02 14:02:01
I loved the Head First series book on object oriented design. It was a very gentle and funny introduction to the subject. I am currently taking a data structures class and find the text we are using (Kruse/Ryba Data Structures and Program Design in C++) to be very dry and hard to comprehend. This is mostly due I think to my own limitations in the area of Mathematics. Does anyone know of a Data Structures text that is written in a lighter style, with a sense of humor, that still covers all the basics like Binary Trees, B Trees, and Graphs? The Algorithm Design Manual by Steve Skiena isn't