graph-theory

small cycle finding in a planar graph

I have a geometric undirected planar graph, that is a graph where each node has a location and no 2 edges cross, and I want to find all cycles that have no edges crossing them. Are there any good solutions known to this problem? What I'm planning on doing is a sort of A* like solution: insert every edge in a min heap as a path exte...

Finding equal subgraphs

Given: a directed Graph Nodes have labels the same label can appear more than once edges don't have labels I want to find the set of largest (connected) subgraphs which are equal taking the labels of the nodes into account. The graph could be huge (millions of nodes) does anyone know an efficient solution for this? I'm looking for...

Finding Directed Acyclic Graph (DAG) Minimal Elements (Vertices) with XSLT/XPath?

I have an XML file that encodes a directed acyclic graph (DAG) that represents a partial order. Such graphs are useful for things like specifying dependencies and finding critical paths. For the curious, my current application is to specify component dependencies for a build system, so vertices are components and edges specify compile-t...

Planar graph

I have a Planar graph with n nodes and e edges that slices the plain into s section. What is the upper limit for s as a function of n and e and e/n? I'm trying to find how little memory I can count on some code using. It's easy to show that e is not more than n*(n-1)/2 but I have a feeling that it's going to be a small integer. For...

Graphs: find a sink in less than O(|V|) - or show it can't be done

I have a graph with n nodes as an adjacency matrix. Is it possible to detect a sink in less than O(n) time? If yes, how? If no, can you prove it? Sink: a node that has incoming edges from all other nodes and no outgoing edges. ...

How to do directed graph drawing in PHP?

I'm looking for a way to draw directed graphs in PHP. (as in http://upload.wikimedia.org/wikipedia/commons/0/08/Directed_acyclic_graph.png). I want it to create an image of the graph just like GD can output an image. I've googled a lot on this, but I only can find a lot of libraries for drawing graphs in general (with bars etc), not dir...

Fastest algorithm for detecting a loop in a graph

Given an undirected graph what is the best algorithm to detect if it contains a cycle or not? A breadth first or depth first search while keeping track of visited nodes is one method, but it's O(n^2). Is there anything faster? ...

Finding the path with the maximum minimal weight

Hi I'm trying to work out an algorithm for finding a path across a directed graph. It's not a conventional path and I can't find any references to anything like this being done already. I want to find the path which has the maximum minimum weight. I.e. If there are two paths with weights 10->1->10 and 2->2->2 then the second path is c...

flash component for printing graph

Hello, Is there a class/component/library for drawing graphs in flash ? And i am not talking about the bar charts, but actual graph like neural graphs, or road graphs etc. Also if someone has experience with it, how big a graph can be plotted out until it becames to big and it loads verry hard ( how much nodes, routes ). Thanks a lot....

What is the name of this type of directed acyclic graph?

Perhaps it isnt even a DAG, but as its naming im after i wasnt sure what title to give this... What is the name of a data structure where every node can only have 0 or 1 paths INTO it? Strictly, is this a tree? Thanks ...

An efficient algorithm to compute a line digraph from a digraph

Does anyone know an efficient algorithm to compute a line digraph from a digraph? See http://en.wikipedia.org/wiki/Line_graph (The Wikipedia article mentions the digraph case near the bottom (in the Generalizations sections). Ideally I would like to do this in linear time. From that section: If G is a directed graph, its directed ...

incremental k-core algorithm

Calculating the k-core of a graph by iteratively pruning vertices is easy enough. However, for my application, I'd like to be able to add vertices to the starting graph and get the updated core without having to recompute the entire k-core from scratch. Is there a reliable algorithm that can take advantage of the work done on previous it...

Using graph theory to generate an exam schedule

Hey SO, I came across this website while looking for help on the internet regarding adj. matrix / graph theory. My program layout is as follows: student name + courses stored in a 2D array array with all distinct courses I am trying to achieve the following: use adjacency matrix to create an exam schedule where no student needs ...

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

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 ...

Matching algorithm

Odd question here not really code but logic,hope its ok to post it here,here it is I have a data structure that can be thought of as a graph. Each node can support many links but is limited to a value for each node. All links are bidirectional. and each link has a cost. the cost depends on euclidian difference between the nodes the mini...

Removing cycle dependencies on a directed graph with fixed edges

I have a directed cyclic graph. Some edges are FIXED and may not be removed. The other edges may be removed to break a cycle. What is the best way to do remove the cycles in this graph? The traversal should be as much as a DFS as possible and start at a given node. ...

Checking if a graph is random using the Erdős–Rényi model?

Given some graph, I would like to determine how likely it is that it was generated randomly. I was told that a comparison to the Erdős–Rényi model was a good way to get this information, but I can't quite figure out how to do that. Any advice? ...

Graph- Theory

I am interested in finding the total number of cycles and cycles length in an connected undirected graph. If I can use DFS or DFS can only find a single cycle. Any code will definitely help ...... Thanks! Hassu ...

Calculate Family Relationship from Genealogical Data

I would like to be able to calculate the family relationship between two individuals in a family tree, given the following data schema (simplified from my actual data schema, only showing columns that directly apply to this problem): individual ---------- id gender child ---------- child_id father_id mother_id With this structure, ho...

Names of Graph Traversal Algorithms

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...