# Tagged Questions

a mathematical structure that contains a collection of vertices or 'nodes' and a collection of edges that connect pairs of vertices

42 views

### All minimum cuts in flow network [migrated]

I'm trying to prove that for a flow network, maximum flow f, and each minimum cut S that f(S)=c(S). Max flow min cut promises that there exists a cut where f(S)=c(S); I want to prove that given ...
38 views

### How to describe a set of paths in a graph with as few nodes as possible?

I have modeled a problem as a graph that consists of many trees. Some of the nodes in the graph may belong to more than one tree. I am trying to describe a subset of paths in the graph with as few ...
58 views

### Graph database keeping historical relationships

I'm starting the modeling of the following problem: I have many clients (millions) that interact in a network forming a graph. At the highest granularity of my business problem, each realationship ...
32 views

### efficient graph clustering algorithm for weighted directed graphs based on node and edge weights

I'm looking for an algorithm to cluster weighted directed graphs that have weights on both edges and vertices. I'm using graphs with multiple weights(labels) on vertices and a weight on edges that ...
32 views

### Finding subgraphs in non-directed graph

Problem at hand: Finding separate subgraphs. Update on adding or removing edges. First I've been thinking about running DFS after every operation from both ends of the edge, but if I keep ...
95 views

### What Graph Theory approaches or algorithms are useful for designing a House?

I have a set of data about a family, and I want the software to find a house design that fits the data (which includes stuff like preferences and whether they want a pool. The current way I am going ...
55 views

### The maximum number of induced cycle in a simple directed graph

Given a simple directed graph G=(V,E) an induced cycle is a cycle where no two vertices of the cycle have an edge that is not in the cycle. (Chordless cycles are induced cycles with at lease 4 ...
214 views

### Are there multiple Hamiltonian Paths on a Graph?

Can anyone suggest an algorithm for this problem. Given an undirected unweighted cyclic graph, and a given start and end node in that graph, I'd like to determine if there is exactly one valid path ...
84 views

### Yen's k shortest paths algorithm

I'm currently trying to understand Yen's k shortest paths algorithm. I based myself on the original paper as well as on the Wikipedia article, but still cannot see why it is correct if k > 2. In fact, ...
142 views

I have a problem dealing with word ladders. The problem is: given two words and a dictionary file, find the shortest word ladder between the two words. So if given the words cat and pot: cat -> ...
123 views

### Modelling a complex schedule of work

I've got a real-world problem that I'm trying to represent and automate. I've simplified and abstracted it down to the following: There are n places of work (P1, P2, ..., Pn). Each place, Pn has a ...
248 views

### Algorithm to determine the fastest route passing in all points

Given a starting point A and an end point E, I need an algorithm to determine the minimum transit route in a city that passes through all points (A, B, C, D, E) and is the fastest possible. I know I ...
65 views

### Dynamic Programming: Shortest path with exactly k edges in a directed and weighted graph

I came across this problem of finding the shortest path with exactly k edges. After some searching, I found the code below. It uses a 3D DP. States are there for number of edges used, source vertex ...
38 views

### Partition edges into areas

If I have a series of edges that branch and curve, such as in a road network, is there an algorithm that will identify the areas (defined by sequence of geographic points) defined between those lines? ...
69 views

### How many vertices/nodes are too many in a graph and stop being beneficial?

Background I'm working on a project that requires me to keep track of transactions as well as the flow of items in a game. In order to do that, I'm storing those transaction in a graph db (Orient-DB)....
46 views

### Benefit and graphical representation of directed acyclic graph in code development

I think the relationship amongst the modules of a code can be represented by a directed acyclic graph (DAG) where a vertex represents a module and a directed edge from vertex a to vertex b represents ...
147 views

### The way to implement a configurable (at run-time) default style

I am coding a visualizer of graph algorithms. Each vertex of the graph has a style (color, size etc.). As long as the algorithm has done nothing to a vertex, that vertex has a default style. The ...
78 views

### Determine equality of a DAG

Given a fairly traditional node class (below), whats the best way to implement equality on a given graph? If our node looks like this public abstract class Node{ private final Set<Node> ...
89 views

### Decision making algorithm

I'm currently solving an optimisation problem of my own design, just to experiment and learn a little something. Here's the concept: I have a user that starts at home. The objective of this user is ...
204 views

### Algorithm to generate Edges and Vertexes outwards from origin with max multiplicity of 3

I am creating a 2d game for a website where the universe can grow extremely large (basically infinitely large). Initially, the universe is composed of 6 stars that are an equal distance from the ...
46 views

### Graph grouping with criteria

I start with a list of adjacent tetrahedra, where there are tight seals to one another along faces for two tetrahedra that are adjacent. The vertices belonging to these faces for both tetrahedra are ...
133 views

### Single Source Shortest Path

In the lecture we are taught that we can solve All Pairs Shortest Path(APSP) with matrix multiplication. In APSP we are creating a distance table for all the distances between each nodes in the graph....
346 views

### Workaround for implementing operations on doubly linked or circular data structures in languages with immutable data

I would like to learn how to make graphs and perform some local operations on them in Haskell, but the question is not specific to Haskell, and instead of graphs we may consider doubly linked lists. ...
250 views

### How to optimize/parallelize the following clustering/joining algorithm:

I have relatively-small algorithm that takes up ~60% of the total run-time of my scientific code (57 lines of 3600), so I would like to find a way to optimize what I'm doing and make the code order-...
96 views

### Are these graph coloring algorithms equivalent?

Suppose you want to color the vertices of a graph in a greedy fashion, given a predetermined order of these vertices. The goal is to avoid giving two adjacent (linked by an edge) vertices the same ...
159 views

### undirected c++ graph with a direction [closed]

I want to create a Graph in C++ that has directions, with directions I don't mean the direction of an edge but what I want is an undirected graph where the edges have a direction to the next vertex, ...
93 views

### Belman-Ford 2d array variation problem

I've got a problem with applying a Bellman-Ford algorithm to 2D Array (not to graph) Input array has m x n dimensions: s[1,1] s[1,2] ... s[1,n] -> Exit s[2,1] s[2,2] ... s[2,...
42 views

### Filter out noise in line graphs

I have a question regarding finding relevant events in a line graph. The following graphs show the views (y-axis) of a video over time (x-axis). Certain events lead to an huge increase in views and ...
307 views

### Dependency ordering algorithm of a compiler

Let's say, hypothetically, I'm writing a Java compiler. And we assume that in my case a class can't be fully compiled until all signatures of dependencies (imports and other used classes) are known. ...
61 views

### How an add vertex operation could be performed in constant time for a graph represented using adjacency list?

Adding a vertex in a graph that is represented using an adjacency list takes O(1) time complexity according to http://bigocheatsheet.com/ (graph operation > adjacency list > add vertex). It is said ...
240 views

### why adding a vertex in a graph represented using an adjacency matrix takes O(|v|^2) time complexity?

Adding a vertex in a graph that is represented using an adjacency matrix takes O(|v|^2) time complexity according to http://bigocheatsheet.com/ (graph operation > adjacency matrix > add vertex). But ...
264 views

### Does a tree node have an ancestor?

Below is a rooted tree, where any node C except root has one parent P Ancestors of a node C are the nodes on path from C to root, including P,P's parent,P's grandparent, .... till root. My ...
160 views

### Approaches to Modeling a Graph Database over the Google App Engine Datastore?

I want to model a graph database over the Google App Engine Datastore. I am currently working on creating a Link entity to model the concepts of link/edge/relationship to the graph of objects. I am ...
160 views

### Efficient algorithm for hierarchical traversing? JSON hydration, for example

I'm writing a small library that helps you hydrate JSON data into objects. Given this JSON example: { "date": "1970-01-01 00:00:00", "foobar": "baz", "user": { "name": "foobar", ...
259 views

### Finding the optimal root

I am trying to solve a quora hackathon challenge question. The question descrpition is as follows : For the purposes of this problem, suppose Quora has N questions, and question i (1≤i≤N) takes ...
35 views

### How can I avoid needing to check for the existence another vertex when adding to an adjacency list?

I'm writing a Graph, and decided to make the Adjacency List its own class. Right now, (stripped down) it looks like this: public class AdjacencyList<Vertex> { //A map between a vertex, ...
147 views

### How definite of an order is there to a depth-first search of a graph?

I have the following graph that I need to simulate a depth-first search of; starting at g: My question is: How definite of an order is there when performing a depth-first search? When doing a DFS of ...
315 views

### Algorithm to find the optimal trade route (negative cycle with lowest cost per edge in a digraph)

Given the following problem (a slightly simplified description of trading in the computer game Escape Velocity: Nova (system map)): Given a set of (solar) systems. Each system is connected by ...
141 views

### Graphs and minimum spanning trees?

I am having a hard time finding information on how Graphs and spanning tree's work and how to construct/structure them. The reason is that I'm using a Delaunay Triangulation algorithm within the ...
327 views

### How to implement efficient heterogeneous microservice data queries?

Our team has an idea of implementing a simple declarative DSL that would let users query the enterprise's domain model via a single interface without caring which specific microservices to call to get ...
192 views

### Algorithm to find whether there is a path (any path) above length X between two vertices

We all know how to find the shortest path between two vertices, but what if I just want to know the answer to this question - is there a path, (any path), between vertex A and B of length larger than ...
66 views

### algorithm for group reassignment of points

I have a list of clustered points but they are not in the cluster which has the center closest to them. The objective is to reassign them to minimize the total distance of each point to its cluster ...
242 views

### Graph visualization algorithm

I need a 2d or 3d graph visualization algorithm by which adding/removing a node or a relationship does not have a butterfly effect on the positions of other nodes. (We are talking about a directed ...
190 views

### What is the maximum number of steps to find a bug using bisecting?

Assume that a node A in the commit tree of a codebase contains a bug but some ancestor B of A is clean from that very bug. Given the topology of the commit tree [B,A] leading from B to A, can we ...
56 views

### Render order of two-edge directed node graphs

I'm trying to find an algorithm for graphs with the following contents: Nodes with no edges leading out of them (shown here as a red circle) All other nodes have exactly two edges leading out (...
81 views

### All clustering possibilities for a graph

Is there a known algorithm for finding all clustering possibilities for a directed graph? EDIT: By cluster i mean a weakly connected sub-graph G, so that E(G) > 0. By a clustering possibility I ...
49 views

### Domination algorithm in graphs

I'm working on a project, on an app, that can visualize undirected graphs and show on this domination algorithm. There are some examples: I have some open questions about programmable solution of ...
295 views

### Big graph traversal with OOP

I'm trying to solve a algorithmic contest's problem. I have a matrix 2000x2000. I want to represent it as graph and traverse it with BFS/DFS. I have time limits on app running (2s). Simple vertices ...