graph

Extjs: Graph Major and Minor Units

Hi, I have created a graph in extJS and was wondering if people know of a general formula to calculate the major and minor units of the X-Axis. I know Extjs should do it automatically, but its not working and want to do it manually any way as I am already setting the maximum and minimum values. Thanks for any help : ) Some code I ha...

Java: How does my Prim's look?

I am trying to implement Prim's minimum spanning tree algorithm with JGraphT. How does it look? One issue I ran into was JGraphT's handling of everything like it's directed. So sometimes it is necessary to make some awkward calls to reverse g.getEdgeSource(e) and g.getEdgeTarget(e) if they didn't happen to be right. I tried to implemen...

Prim's MST: Does the start node matter?

I intuitively feel that if one is using Prim's algorithm to find a graph's minimum spanning tree, it doesn't matter which root node is picked - the resultant MST will have the same weight regardless. Is this correct? ...

Error when generating pdf using script in R

I'm using R to loop through the columns of a data frame and make a graph of the resulting analysis. I don't get any errors when the script runs, but it generates a pdf that cannot be opened. If I run the content of the script, it works fine. I wondered if there is a problem with how quickly it is looping through, so I tried to force it ...

Graph on an access form

Hi, I have some code at the moment to draw a graph based on the values of a series of text boxes on an access form. I’m happy with the code and how it works but I’m not convinced that it is the most efficient way of doing this. The graph takes about 1.2 seconds to redraw each time. The form is unbound so it is just getting the values f...

Java Code Review: Generate a subgraph

I'm using JGraphT and I want to generate a subgraph, like this: If there's a graph like {stuff -> a -> b -> stuff}, and you ask for the subgraph in direction of {a -> b}, you'll get {a -> b -> stuff}. (stuff = collection of nodes and edges, -> = an edge, a and b are nodes.) My idea is as follows: if the start is A, and the sink is B, r...

Simulating a railway network

Hello, I wanted to simulate a railway network where there would be stations, trains and routes connecting each station. So how do you think I should attempt to model this?? I thought of using graphs taking station as vertex and edges as routes. Also since there will be tens of trains and stations and hence hundreds of routes so should I...

Water Jug problem in Die Hard 3 into a graph

Hi, im not too sure how to implement this... I need to create a weighted directed graph based on the water jug problem from the movie Die Hard 3 (http://www.wikihow.com/Solve-the-Water-Jug-Riddle-from-Die-Hard-3). I need to create nodes for all the possible moves (fill, empty, pour). After i need to find the shortest path to the soluti...

Tournament graph

A tournament is a directed graph (digraph) obtained by assigning a direction for each edge in an undirected complete graph. That is, it is a directed graph in which every pair of vertices is connected by a single directed edge. Data structure is adjacency matrix. What s an algorithm to find if the graph is a tournament graph? ...

What are the chart/map options, without using XML?

I'm looking for a chart/map library that can do a wide variety of graphs and maps, including treemaps, worldmap, line/pie charts etc. The data is going to come from the database, so I am not looking at XML/CSV stuff. It should also have at least minimal interactive options, like zooming etc. fusioncharts looks good, anybody has othe...

Homework: Generating Graphs

I need to simulate a discrete event simulator and for that I need to generate a network consisting of 30 nodes and then check if the generated graph is directed or not. Can anyone guide me on how to start with this. I should not be using the boost library to do this. Yes this is an assignment, I need an advice to start with. I just need ...

PostgreSQL: How to optimize my database for storing and querying a huge graph

I'm running PostgreSQL 8.3 on a 1.83 GHz Intel Core Duo Mac Mini with 1GB of RAM and Mac OS X 10.5.8. I have a stored a huge graph in my PostgreSQL database. It consists of 1.6 million nodes and 30 million edges. My database schema is like: CREATE TABLE nodes (id INTEGER PRIMARY KEY,title VARCHAR(256)); CREATE TABLE edges (id INTEGER,li...

which is a better language (C++ or Python) for complex problem solving exercises (ex. Graphs) ?

I am trying to work on some problems and algorithms. I know C++ but a friend told me that it would be better if done with Python.As it would be much faster to develop and less time is spent in programming details which does not actually earn anything solution wise. EDIT 2: I plan to use python-graph lib from Google-codes, Please provide...

2 Axes Reportlab Graph

Hi, I have managed to create a 2 axes graph in ReportLab, by overlapping a barchart and linepot. Here is the code for anyone interested in something similar: from reportlab.graphics.shapes import Drawing,colors from reportlab.graphics.widgets.markers import makeMarker from reportlab.graphics.charts.barcharts import VerticalBarChart fro...

Generating statistics from Git repository

I'm looking for some good tools/scripts that allow me to generate a few statistics from a git repository. I've seen this feature on some code hosting sites, and they contained information like... commits per author commits per day/week/year/etc. lines of code over time graphs ... much more Basically I just want to get an idea how muc...

Complexity of finding all simple paths using depth first search?

Thanks to everyone replying with ideas and alternate solutions. More efficient ways of solving problems are always welcome, as well as reminders to question my assumptions. That said, I'd like you to ignore for a moment what problem I'm trying to solve with the algorithm, and just help me analyze the big-Oh complexity of my algorithm as...

Stack overflow error for large inputs in Java

I'm writing a Java program that searches for and outputs cycles in a graph. I am using an adjacency list for storing my graph, with the lists stored as LinkedLists. My program takes an input formatted with the first line as the number of nodes in the graph and each subsequent line 2 nodes that form an edge e.g.: 3 1 2 2 3 3 1 My proble...

Suggestions on better contextual lookup algorithm?

I am developing an application that provides contextual knowledge lookup. The application is in its design phase. I need to know whether a simple graph structure and a traversal algorithm would be sufficient or whether I should go with a neural network. I want to go with the most long-term solution. I am thinking of representing indivi...

Connectivity of a Graph

int dfs(int graph[MAXNODES][MAXNODES],int visited[],int start) { int stack[MAXNODES]; int top=-1,i; visited[start]=1; stack[++top]=start; while(top!=-1) { start=stack[top]; for(i=0;i<MAXNODES;i++) { if(graph[start][i]&&visited[i]==0) { stack[++top]=i; printf("%d-",i); ...

What to use to create bar, line and pie charts with javascript compatible with all major browsers?

I used to work with flot but it doesn't support pie charts so I'm forced to change. I just saw JS Charts, but their documentation is very obscure regarding cross browser compatibility (I need it to be IE6+ compliant :). Also this will be for commercial use, so I'd rather have something that I can use free of charge jQuery Google chart...