graph

Elegant examples of xslt?

After a long learning loop via XAML, I've returned to HTML and javascript, and realised that the concept of declarative code - in terms of rules for transformation - is an incredibly powerful concept. Despite its surfeit of syntax, XSLT processing of XML is the keystone of declarative transformation programming. I have, however, always ...

Munin: Is it possible to recover lost graphs?

Hello, I'm not extremely familiar with how munin works, so I apologize if this is obvious. I've been using munin for a couple of my projects now and I've run into this twice where I will lose all my munin graphs that were generated from past events. This just happened to me this afternoon. Now, I only have a track record of all system e...

Correct way to standardize/scale/normalize multiple variables following power law distribution for use in linear combination

I'd like to combine a few metrics of nodes in a social network graph into a single value for rank ordering the nodes: in_degree + betweenness_centrality = informal_power_index The problem is that in_degree and betweenness_centrality are measured on different scales, say 0-15 vs 0-35000 and follow a power law distribution (at least...

What are some examples of problems that are best solved with graphs?

After reading Stevey Yegge's Get That Job At Google article, I found this little quote interesting: Whenever someone gives you a problem, think graphs. They are the most fundamental and flexible way of representing any kind of a relationship, so it's about a 50–50 shot that any interesting design problem has a graph involved in it. M...

Finding the smallest subtree

Given a graph of n nodes that are all interconnected on a coordinate plane, what's the best way to find a subtree of minimal distance that contains m nodes? The only solution I've found to this problem is to generate all combinations of the nodes to connect and attempt to connect these nodes via either Kruskal's or Prim's algorithm whil...

Find the paths between two given nodes?

Say I have nodes connected in the below fashion, how do I arrive at the number of paths that exist between given points, and path details? 1,2 //node 1 and 2 are connected 2,3 2,5 4,2 5,11 11,12 6,7 5,6 3,6 6,8 8,10 8,9 Find the paths from 1 to 7: Answer: 2 paths found and they are 1,2,3,6,7 1,2,5,6,7 implementation found here...

creating boost::graph edge_weight property map

Hi, using boost::graph with bundled properties. I want to be able to run searches using a variety of different possible edge weighting schemes. I'd like to not create an additional class for the bundled properties if possible, and pass in different weight maps depending on the type of search without creating a new graph or modifying all...

Longest Simple Path

So, I understand the problem of finding the longest simple path in a graph is NP-hard, since you could then easily solve the Hamiltonian circuit problem by setting edge weights to 1 and seeing if the length of the longest simple path equals the number of edges. My question is: What kind of path would you get if you took a graph, found t...

Can someone explain Breadth-first search?

Can someone explain Breadth-first search to solve the below kind of problems I need to find all the paths between 4 and 7 ...

Is the stackoverflow community a scale-free or a small world network?

I am a graph/network enthusiast and this just for my curiosity :) I am trying to model the StackOverflow community as a graph/network. Assume that the people in the SO community are nodes and that the answers given to any of the question establishes a relationship between these nodes. The relationship can be assumed to be directed(li...

Graphics module for python

Hi everybody, I'm pretty new on python and I'm looking for a good graphics module, especially to draw histograms, pie charts and stuff like that. What would you recommend to me ? ...

How do I add text to graph in Perl's GD::Graph?

I am drawing a graph using GD::Graph module in Perl. I can draw the graph fine but in the drawn image I want to add some text around the top of the drawn graph image. Basically just want to add some text to this drawn image. However, I don't see an option to do that. Does someone know if this is doable? ...

Application for graphing lots of web related data

I know this isn't programming related, but I hope some feedback which helps me out the misery. We've actually lots of and different data from our web applications, dating years back. For example, we've Apache logfiles Daily statistics files from our tracking software (CSV) Another daily statistics from nation-wide rankings for advert...

Looking for a simple Java API for creating graphs (edges + nodes)

I'm trying to find a simple Java API for creating graph relationships - addEdge(), addNode(), isConnected(node1, node2), findPaths(node1, node2), etc. No UI, just logic. I can find a bunch of academic projects, but none seems to be "The Definitive Graph API". Does anyone know if such a thing exists? ...

How can I recursively search a list of lists for an item, getting the "closest" match

This may take a little explaining, so please bare with me. I have a class "Class" which has a member std::list, I want to search that list/tree for an item, specifically an item with a specific name. A basic representation of my class is as follows. #include <list> #include <string> class Class { std::string _name; std::list<C...

How do I impose the y position on a node when using graphviz to draw lattices?

I am using Graphviz to draw a lattice. The nodes are set of numbers. Being a lattice, I would like the height position (the y) of a node to represent the number of elements in the set represented by the node. Then the x position should be defined by graphviz to make the representation cleaner. Is it possible? According to the dot docu...

Sorting a graph to make as many arrows point forward as possible

I need to sort the nodes of a directed graph such that the number of arrows that flow backwards (against the sorting order) is minimal. I can think of algorithms (e.g. keep swapping nodes until no swap will improve things) but I'm not sure how fast they run or whether they arrive at the best solution. What is the name and complexity of...

Graph drawing library for Flash

I have a bunch of numeric stats data gathered over time. I need to show it as a line graph to user in a HTML page. I want to render graph on client. It would be perfect if graph would be interactive (allowing user to scale, scroll, toggle graph lines visibility etc.). Is there any decent free graph drawing library for Flash / Flex (or...

Plotting a function with centered axes

I had a short look at some popular plotting libraries but haven't found what I need until now. Basically I'm looking for a library or tool that generates a graph as it is known from school. That means not an axis description at the outer left and one at the bottom, but two crossed axes, mostly positioned in the center of the graph. You...

Vertical labels with google charts API?

Anyone know how to get x-axis labels to be vertical with google charts API? I need to fit a lot of labels in a small chart. Thanks ...