graph

Find cycle of shortest length in a directed graph with positive weights

Hi guys, I was asked this question in an interview but i couldnt come up with any decent solution. So, i told them the naive approach of finding all the cycles then picking the cycle with the least length. I'm curious to know what is an efficient solution to this problem. Thanks, Chander ...

How can I hide the image link in facebook wall with the Graph API?

Hello, I have posted a message to my facebook wall through my web site, that contains also a picture. What I want now is hide the link of the picture that is shown there but still make the picture work as a link. I am using: $facebook->api('/me/feed', 'post', array('message'=> $message, 'description'=> $description, 'picture'=> $image, ...

How To implement Facebook friends module in Database?

I am developing a facebook type application for my institute. and I am stuck at the friends module. i.e. How to know if the particular users are one's friends. I googled a lot but didn't get any satisfactory answers. What I got is : there will be many friends of a person and implementing users and their friends in seperate table will ...

PHPPowerPoint generating Tables and Graphs within the PPT

Hi All, I am using PHPPowerPoint to generate PPT files from PHP and it visually does the job very well, I am looking for a way of generating tables and graphs that are editable within the powerpoint program. I anyone can help or lead me towards a linux/php binary/class that can accomplish this i would be most grateful. Best regards D...

Graph theory questions from my Algorithms quiz today that I'd like help understanding

Today I had my algorithms quiz for the semester and I can't figure out these two questions and they've been bugging me all day. I've gone through my notes and the lecture notes and I'm still unsure. I would appreciate it if someone could take a look and provide some insight into these questions. These are not homework and I've already sa...

Combinatorial optimization

Suppose we have a connected and undirected graph: G=(V,E). Definition of connected-set: a group of points belonging to V of G forms a valid connected-set iff every point in this group is within T-1 edges away from any other point in the same group, T is the number of points in the group. Pls note that a connected set is just a connec...

How best to display JGraphX?

Is it possible to display a JGraphX by adding it to a JLable? Much of testJGraphX (below) is taken from the JGraphX Hello World example, but the graph is not displayed in jLable1. Is there a better container than JLabel for a JGraphX? public class TestJGraphX extends javax.swing.JFrame implements TableModelListener { public TestJGra...

Add unit to yaxis labels in MatPlotLib

I am trying to add mi or km (miles, kilometers) after the value on the yaxis of a matplotlib bar chart. Right now I am just supplying matplotlib the values and it is making the yaxis labels automatically. I can't figure out how to append mi to the end of a value. 24 > 24 mi There is an option for ax.set_7ticklabels(), but then I ...

CouchDB - Has anyone implemented a path/graph finding algorithm? Is it possible?

Has anyone implemented a path finding algorithm (A*, Dijkstra's algoritm, Breath First Search, etc.) using CouchDB's maps & views? Is it even possible? I've seen some implementations for other mapreduce software (e.g. http://horicky.blogspot.com/2010/02/nosql-graphdb.html), however they rely on an global state, which CouchDB lacks (right...

adjacency matrix

my question is given an adjacency matrix of a graph and a positive interger n find the number of path of length n between two vertices,i don't know how to convert to programming? somebody can help me. ...

Java Class Design - Graphs

Hey there, I'm fairly new to Java, and I need some help figuring out a good class hierarchy and overall design for an assignment we've been given (i'm studying CS). The assignment is graph-theory related, so we were asked to create interfaces for 2 types of graphs, simple graphs and multi-graphs (which are allowed to have parallel edge...

Line plot in GnuPlot where line color is a third column in my data file?

Hi Everyone, I have a datafile that looks like this: 1 1.0 0 2 1.5 0 3 0.0 1 4 1.2 2 5 1.0 1 6 1.1 1 where the first column is my X value, the second column is my Y value, and the third column is a color. I'd like for each line segment to be colored according to the third column. So the first two line segments would be "color 1", th...

FluentNHibernate mapping many-to-many to the same entity or how to map a graph?

Hello, I have a situation where I need to store a graph data structure in the database. This means an entity can have unlimited number of related entities of the same type (related entity can have unlimited related entities as well). I was thinking that many-to-many relationship would solve my problem. I'm trying to do mapping with F...

How do I generate a word 2007 document with graphs using a c# .net program?

I have successfully done this using "MSGraph.Chart.8" in VS 2010 and c# and the graphs look ancient and pixelated like back in 1995 or so. The help online seems all the same. like this one... http://support.microsoft.com/kb/316384 I really need to generate these word documents with nicer graphs in code, or at least edit an existin...

Maximum weight bipartite matching

I have a graph in form of a rectangular grid, i.e. N nodes and 2N edges, all adjacent nodes are connected. This means it is two-colourable, and hence it is possible to do bipartite matching on it. Each (undirected) edge has a weight assigned to it - either -2, -1, 0, 1 or 2. No other values are allowed How would I go about finding the ...

Weighted n-coloring problem algorithms

I have 100 vertices and a function f(x,y) that computes the weight of the edge between vertex x and vertex y. f is not particularly expensive, so I could generate an indexed adjacency list with weights, if necessary. What are some efficient, tractable methods for optimizing the n-coloring of these vertices by minimizing or maximizing t...

Storing graphs in fully-normalized relational databases

I've nearly killed myself, multiple times, trying to find the perfect, flexible schema for storing many different types of objects with a wide variety of links between them in a relational database. But models such as EAV and things like polymorphic relationships just aren't true to relational databases. After learning about NoSQL graph...

What is the best way to create a map with mouse over?

What is the best way to create a 2D plot, with different points in different coordinates (x/y coordinates) such that they are represented using different shapes on the plot, and whenever we click on one of them, or go with mouse over them, we see a text changing in a small window next to the plot? If I could do this in HTML, that would ...

Problem with Graph Traversal

Hi I have implemented a graph traversal algorithm which finds a path between two nodes in the graph. The problem is that it only finds a path for some queries when I know that there is a path between every node public List getDirectRoute(Node start, Node end) { //Uses Dijkstras List<Node> vis = new LinkedList<Node>(); Map...

Facebook Graph API for non-English searh terms

when I try to search non-English search-terms like https://graph.facebook.com/search?q=手机&amp;type=post 手机 = mobile phone I only got 12 posts about it. I think the real amount of recent posts in Facebook talking about this term should definitely be much more than 12. Is this because there are really not many people using non-English c...