a mathematical structure that contains a collection of vertices or 'nodes' and a collection of edges that connect pairs of vertices

learn more… | top users | synonyms

6
votes
3answers
2k views

What algorithm should I use to find the shortest path in this graph?

I have a graph with about a billion vertices, each of which is connected to about 100 other vertices at random. I want to find the length of the shortest path between two points. I don't care about ...
-2
votes
1answer
603 views

using ant colony algorithm to create cross word game [closed]

I have difficulty to learn about ant colony algorithm (ACO), I have read about generating crossword game using (genetic algorithm) GA.I Know both of GA ant ACO usually used for optimization, but my ...
18
votes
6answers
646 views

Visiting points on a number line while minimizing a cost not related to distance

I need some help on this ACM ICPC problem. My current idea is to model this as a shortest path problem, which is described under the problem statement. Problem There are N = 1000 nuclear waste ...
2
votes
1answer
449 views

Finding subtree in a tree

I have a tree: a / \ b c / \ d f / \ g h And the pattern: x / \ y z / \ q p As output I would like to have: x: a y: b z: c q: d p: f and x: b y: f z: c q: ...
6
votes
2answers
140 views

spotting graph cycles - simple explanation

could some please help me understand how to find cycles in graphs in laymans terms? I have read other questions, such as This one and also some of the wikipedia pages, but they seem to descend rather ...
1
vote
2answers
1k views

What is the best way to plot 3D/2D plots with real time data? [closed]

First of all, I like to use Python, because it is easy to work with. I am not a programmer, so I prefer anything that is easy to use and understand. I understand that it might be faster to program 3D ...
1
vote
1answer
180 views

Implementing a sort of navigation system

So I am undertaking a project which does navigation sort of thing. So here is how the problem statement looks like. Say, given a map of a floor, with different rooms, now somehow, this information is ...
6
votes
3answers
1k views

Cyclomatic complexity with two IFs - why it is 3?

I have read an article with following example: void func() { if (condition1) a = a + 1; if (condition2) a = a - 1; } It says the CC is 3 as there are three possible paths. How come? Why not 4? I ...
3
votes
2answers
237 views

Chambers In A Castle Algorithm

Problem Statement - Given a NxM grid of 1s & 0s (1s mark walls, while 0s indicate empty chambers), the task is to identify the number of chambers & the size of the largest. And just to ...
1
vote
2answers
1k views

Tree vs Graphs in search

Could anyone give a clear and concise explanation for when you use graphs vs when to use trees for data structures?
31
votes
7answers
8k views

When to use DAG (Directed Acyclic Graph) in programming?

I recently found a framework named ecto. In this framework, a basic component named "plasm", which is the ecto Directed Acyclic Graph.In ecto, plasm can be operated by ecto scheduler. I am ...
5
votes
4answers
2k views

What are graphs in laymen's terms

What are graphs, in computer science, and what are they used for? In laymen's terms preferably. I have read the definition on Wikipedia: In computer science, a graph is an abstract data type ...
3
votes
1answer
277 views

Graph/diagram editor that works with pseudographics

Is there a graph/diagram editing tool that can output (or even better also parse) pseudographics, that can be easily inserted into source code comments? Like this: +---------------+ | ...
9
votes
1answer
4k views

Am I right about the differences between Floyd-Warshall, Dijkstra's and Bellman-Ford algorithms?

I've been studying the three and I'm stating my inferences from them below. Could someone tell me if I have understood them accurately enough or not? Thank you. Dijkstra's algorithm is used only ...
0
votes
3answers
635 views

Reasonable Number of Directed Graph Nodes and Edges

How many directed graph nodes are typically represented in the browser? I'm working with some large data-sets with nodes and edges more then 400,000. I'm wondering if I am going down a fruitless path ...
3
votes
2answers
187 views

Custom graph comparison?

I'm trying to compare two graphs using hash value ( i.e, at the time of comparison, try to avoid traversing the graph ) Is there a way to make a function such that the hash values compared can also ...
5
votes
1answer
523 views

Merging similar graphs based solely on the graph structure?

I am looking for (or attempting to design) a technique for matching nodes from very similar graphs based on the structure of the graph*. In the examples below, the top graph has 5 nodes, and the ...
5
votes
1answer
482 views

Algorithm for perfect non-binary graph layout

I have a complex non-binary graph model. Each tree node can have multiple children&parents (a node can also have a connection to it's "brother"). A node is represented as square on screen with ...
2
votes
1answer
1k views

Networkx / Python : Is using a class for a node better practice than defining multiple attributes?

I've read through the NetworkX tutorial and documentation, but was unable to find real world answers for this question. Usually when using NetworkX, I might use strings to define nodes, then set ...
13
votes
3answers
6k views

Efficient graph clustering algorithm

I'm looking for an efficient algorithm to find clusters on a large graph (It has approximately 5000 vertices and 10000 edges). So far I am using the Girvan–Newman algorithm implemented in the JUNG ...
11
votes
3answers
783 views

Randomly generate directed graph on a grid

I am trying to randomly generate a directed graph for the purpose of making a puzzle game similar to the ice sliding puzzles from Pokemon. This is essentially what I want to be able to randomly ...
4
votes
4answers
425 views

Building a route creator

Ok, already up front, I'm going to tell you, that this is a bonus task for Data structure course I'm taking. That should take care of all the questions whether or not this is for a homework. Route ...
5
votes
3answers
2k views

What is an algorithm to find simple cycles?

I have a graph with an Eulerian cycle and no Hamiltonian cycles. I would like to divide this graph into simple cycles. Edges may not be repeated in simple cycles. How can this be done?
2
votes
2answers
300 views

Tool for large scale graph analysis

What are the best tools / frameworks / libraries available to implement and run algorithms on graphs? In particular I need a tool that can load a set of nodes, edges and values assigned to these ...
16
votes
5answers
2k views

Algorithm to determine fastest route?

Let's say we're going from 1 to 5. The shortest route will be 1-4-3-5 (total: 60 km). We can use Dijkstra's algorithm to do that. Now the problem is, the shortest route is not always the fastest ...
2
votes
5answers
632 views

Programming language with native concurrency support for large graphs?

I'm currently looking for a new programming language to learn (currently working through some C++, know some C and Python), specifically one that has built-in concurrency support? I want to try to ...
1
vote
3answers
5k views

Are questions on graphs common in programming interviews? [closed]

Despite saying that graphs are very important, none of my friends have got any graph related questions in interviews in Google and Amazon. I am preparing for these companies right now. Should I ...
5
votes
2answers
1k views

Algorithm for an exact solution to the Travelling Purchaser Problem

do you know of any algorithms which give an exact solution for the Traveling Purchaser Problem. I can only find heuristic and probabilistic approaches. I do have implemented a genetic algorithm so ...
3
votes
2answers
1k views

When can I be sure a directed graph is acyclic?

The definition for directed acyclic graph is this: "there is no way to start at some vertex v and follow a sequence of edges that eventually loops back to v again." So far so good, but I am trying to ...