Graph library for virtual (dynamic) graph search

As a part of a larger algorithm, I need to run graph search algorithm (A* family) on a graph that is created dynamically during the search. I cannot instantiate the whole graph because it is exponentially large though not infinite, and most nodes wo...
more »

2017-09-28 16:09 (0) Answers

N degree of separation interview problm

A was asked an interesting question on an interview lately. You have 1 million users Each user has 1 thousand friends Your system should efficiently answer on Do I know him? question for each couple of users. A user "knows" another one, if they are...
more »

2017-09-02 17:09 (2) Answers

A* star algorithm open and closed lists

I have looked at the implementation of the problem on the internet and i have a question: whenever you add a node you need to search it in the open list(why it is not enough to search it in the closed list?)? And why do you search it to see if you ca...
more »

2017-08-08 21:08 (1) Answers

How to find if a vertex exists in a boost graph?

I have a boost graph (with bundled properties). I want to find if a vertex with a certain value already exists in the graph or not. Can someone help me with this? Here, I present a MWE of my existing code: Live on Coliru #include <iostream> #...
more »

2017-07-27 19:07 (1) Answers

Algorithm to find disconnected graph from sets

Goal: Want to efficiently find all the disconnected graphs from a large collection of sets For example, I have a data file like the following: A, B, C C, D, E A, F, Z G, J ... each entry represents a set of element. First entries A, B, C = {A, B,...
more »

2017-06-16 21:06 (3) Answers

Using A* search algorithm

I am working in graph mining, and for my current research, I am trying to fund the proximity between non-adjacent nodes in the graph. However, since non-adjacent nodes are ubiquitous, so I want to narrow-down the number of non-adjacent nodes that ar...
more »

2017-06-09 18:06 (1) Answers

Uniform Cost Search and its Time/Space Complexity

As part of a programming assignment, I have written a function ucs(G,v) in Python 3 which searches a digraph G which has weighted edges. Three nodes in G are randomly selected as goal nodes, and the task of this function is to apply uniform cost sear...
more »

2017-05-23 23:05 (0) Answers

Split chained integer pairs

I have an array of integer pairs [a, b], e.g [3, 7], [6, 7], [8, 5], [2, 6], [4, 2], [0, 5], [3, 4], [8, 1], [0, 1] These pairs always form chains (closed loops), in this case, there are two of them. The problem is to split given array into n a...
more »

2017-05-22 17:05 (0) Answers

Depth First Search Reversal?

I am making a program which determines whether or not a directed graph is strongly connected. The graph consists of 2 strings (one pointing to the other) and an optional edge weight. I don't understand how to reverse my graph to perform the second D...
more »

2017-05-14 08:05 (0) Answers

Git log --graph format query

I have this graph log (git log --oneline --all --decorate --graph) in my testgit repository: * 760711e (HEAD -> dev, master) Initial commit If I do a commit in my dev branch, the graph log would be this: * c710544 (HEAD -> dev) Initial dev...
more »

2017-05-13 16:05 (2) Answers

Depth First Search Adjacency

Program that checks if a directed graph is strongly connected I have a defaultdict: defaultdict(<class 'dict'>, {'SanFrancisco': {'Houston': '1000'}, 'LA': {'Ames': '300', 'SanFrancisco': True, 'Detroit': '200'}, 'NYC': {'LA': '3000'}, 'Aus...
more »

2017-05-13 05:05 (1) Answers

Python Depth First Search with Dict

I keep seeing pseudocode for Depth First Search that is completely confusing to me in how it relates to my specific problem. I'm trying to determine whether or not a 'directed graph' is strongly connected. If I have a dict with 2 strings (the first ...
more »

2017-05-09 07:05 (1) Answers

Uniform Cost Search in Python

I have implemented a simple graph data structure in Python with the following structure below. The code is here just to clarify what the functions/variables mean, but they are pretty self-explanatory so you can skip reading it. # Node data structure...
more »

2017-04-11 21:04 (1) Answers

Optimizing 2D grid connectivity algorithm

Summary: I'm looking for an optimal algorithm to ensure connectivity over a 2D grid of binary values. I have a fairly involved algorithm that does it in effectively linear time, but only if certain pre-processing steps are performed. The following go...
more »

2017-04-01 22:04 (0) Answers

Why is the graph database so faster?

What are the main reasons for the graph database to be faster than the relational database? We know that the relational implementation is based on B+ tree. And the graph database? Any material that gives details about this? ...
more »

2017-03-04 14:03 (0) Answers

Saving plots in a data.table list column

When I run... library(data.table) DT = CJ(id = 1, id2 = 1:3)[, .( d = as.IDate("2017-01-01")+1:10, v = id*10 + id2*1:10 ), by=.(id, id2)] plotDT = DT[, { par(mfrow = c(uniqueN(id2), 1), mar = c(2,2,.5,2)) .SD[,{ plot(d, v, type...
more »

2017-02-24 23:02 (0) Answers

Greedy Search from point A to point B on a graph

A question in my textbook asked me to calculate and find a route from Mehadia to Bucharest via 1) A Greedy Search and 2) A uniform-cost search. *Now I am able to completely illustrate and solve the route via uniform cost search but my greedy search ...
more »

2017-02-03 07:02 (1) Answers

Custom line style for network graph in R

I am hoping to make a directed network plot with arrowheads (or similar chevrons) along the length of the line... The igraph library seems to use the base polygon function, which accepts lty to specify line types, but these are limited to various ...
more »

2017-01-19 22:01 (2) Answers

Plotting Line Graph with JSON data, Android

I'm total beginner in Android development and I'm doing app for class. My assigment is to display JSON data in application as text and graphs. I'm using Retrofit 2 to display it as text in one activity, but I'm having problems with graphs, I don't kn...
more »

2017-01-11 05:01 (1) Answers

Graph search algorithm with fewest accessed nodes

I need an algorithm to find ANY path from point A to point B in a graph. The problem is that finding out wich nodes can follow a specific one needs a quite lengthy matlab simulation, so i want to access as few nodes as possible. I know some heuristi...
more »

2017-01-10 11:01 (0) Answers

MPAndroidChart: add custom image inside bars

I am using MPAndroidChart and I want to show a custom drawable inside this CombinedChart like in below image: If bar value is >= a goal value, say, 50, then I would like to add a star image inside the bar. Can any one help me for customise the B...
more »

2016-12-27 08:12 (1) Answers