graph

Self-referential data structures in Lisp/Scheme

Is there a way to construct a self-referential data structure (say a graph with cycles) in lisp or scheme? I'd never thought about it before, but playing around I can find no straightforward way to make one due to the lack of a way to make destructive modification. Is this just an essential flaw of functional languages, and if so, what a...

Best GUI concept to edit/manage large acyclic graphs

The point is to enable fast and intuitive management of potentially large graph structures Concepts I've come across are: Tree TreeMap Venn diagram Hyperbolic tree Which one would you prefer or other ideas? ...

Python Graph Library

I'm writing a python application that will make heavy use of a graph data structure. Nothing horribly complex, but I'm thinking some sort of graph/graph-algorithms library would help me out. I've googled around, but I don't find anything that particularly leaps out at me. Anyone have any good recommendations? ...

jQuery Flot identical range ticks

Hi i want to add ticks that are not in a fixed range. i.e my ticks will be 1,2,3,3,3,3,4,5 how would i tell a data set for the graph type to plot points based on the tick number, instead of a fixed range. ...

What is a good strategy for constructing a directed graph for a game map (in Python)?

I'm developing a procedurally-generated game world in Python. The structure of the world will be similar to the MUD/MUSH paradigm of rooms and exits arranged as a directed graph (rooms are nodes, exits are edges). (Note that this is not necessarily an acyclic graph, though I'm willing to consider acyclic solutions.) To the world genera...

C# Graph Traversal

This algorithm does a great job of traversing the nodes in a graph. Dictionary<Node, bool> visited = new Dictionary<Node, bool>(); Queue<Node> worklist = new Queue<Node>(); visited.Add(this, false); worklist.Enqueue(this); while (worklist.Count != 0) { Node node = worklist.Dequeue(); foreach (Node neighbor in node.Neighbors...

A proper way to create a matrix in c++

I want to create an adjacency matrix for a graph. Since I read it is not safe to use arrays of the form matrix[x][y] because they don't check for range, I decided to use the vector template class of the stl. All I need to store in the matrix are boolean values. So my question is, if using std::vector<std::vector<bool>* >* produces too mu...

Ways of representing frequency of updates as a graph?

I want to create a graph representing the frequency of updates to a site (for example, how often I have posted to my blog over the past 5 years). One obvious way to do this is to plot "number of entries posted per month" for the past 60 months, but this feels unsatisfying. Should I be looking at using something like a rolling average ins...

Depth-First Search, How to detect diamond dependencies?

Hi there, I was wondering if anyone can provide some pointers on how to check for diamond dependencies whilst performing a Depth-First Search over a graph...I have the following graph A -> B, A -> F, B -> C, B-> E, C -> D, E -> D. I am trying to construct a hirearchy of containers that represent the specified graph however when i reach...

Different trees

What are "Splay trees”, “Red-black trees”, AVL Tree, B-Tree and T-tree? looking for good implementations. Thanks ...

A question on sub-graph isolation

Dear all, I am working on a problem and I was wondering if you could help me to find an answer: We consider a complete graph with +1 or -1 edges (weights). We want to determine whether there is a sub-graph for which sum of the weights (edges) with the remaining sub-graph is less than 0. I want to know whether there is any polynomial alg...

Finding out what caused equals() to return false

How can I find out what caused equals() to return false? I'm not asking about a sure-way, always right approach, but of something to aid in the development process. Currently I have to step into the equals() calls (usually a tree of them) until one of them is false, then step into it, ad nauseam. I thought about using the object graph,...

pseudo code for finding closed paths in a graph

Hi All, I have an adjaceny matrix for a graph which tracks the edges between the nodes by having a 1 in the corresponding adjMat[i,j] = 1; Through this adjaceny matrix i wish to find out all the closed paths of length 4 which exists in the graph. Can anyone please provide me with a pseudo code. thank u ...

How can I cluster a graph in Python?

Let G be a graph. So G is a set of nodes and set of links. I need to find a fast way to partition the graph. The graph I am now working has only 120*160 nodes, but I might soon be working on an equivalent problem, in another context (not medicine, but website development), with millions of nodes. So, what I did was to store all the lin...

Java GraphViz

Is there an Open Source java alternative to GraphViz? I'm aware of the existence of Grappa which basically wraps the Graph interface to GraphViz as an JavaAPI. However the layouting is still done by the GraphViz binaries. I'm looking for a pure-java, open source library providing the same functions and layouting algorithms as GraphViz. ...

table to horizontal bar graph in jquery

I cannot really tell more I have a table 1-joe-234 2-bob-432 3-sean-654 i like to take it and get a bar graph with it Not that there is no lib on the net, but is prototype or flash xml file -- the solution i am working on, is a jquery plugin that will generate a html link for google chart... not pretty but KISS (really simple) and...

How to search a specific node in a graph structure in C?

Not that I have time to discuss this properly to reach a conclusion and adapt my code because the phase one (of three) of a school project is in 24hrs, but at least I need to know if I did the correct decision. I'm using linked lists and here's my structures: typedef struct sCity { int cityID; char *cityName; struct sCityL...

Modifying vertex properties in a Boost::Graph

I am trying to figure out how to use boost::graph to store some information. However, there is information I want tied to each vertex. Staring at the documentation for the library reveals either(a)badly written documentation, or (b), I'm obviously not as good at C++ as I thought. Pick two. I am looking for either a tutorial on assigning...

Calculating "Kevin Bacon" Numbers

I've been playing around with some things and thought up the idea of trying to figure out Kevin Bacon numbers. I have data for a site that for this purpose we can consider a social network. Let's pretend that it's Facebook (for simplification of discussion). I have people and I have a list of their friends, so I have the connections betw...

Algorithm to establish ordering amongst a set of items

I have a set of students (referred to as items in the title for generality). Amongst these students, some have a reputation for being rambunctious. We are told about a set of hate relationships of the form 'i hates j'. 'i hates j' does not imply 'j hates i'. We are supposed to arrange the students in rows (front most row numbered 1) in a...