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

What do line colors in git log --graph mean?

I'm curious what do line colors mean in git log --graph? Yes, I'm asking about lines | / \ which connect commits * at the left edge of console output. Question #1 Do these colors have some hidden meaning? Or do they are pseudo-randomly chos...
more »

2016-11-18 11:11 (1) Answers

How to embed matplotlib graph in Django webpage?

So, bear with me as I'm VERY new to Django, Python, and web-development in general. What I want to do is display a graph that I've made using matplotlib. I had it working to where the home page automatically redirects to the png of the graph (basical...
more »

2016-11-10 19:11 (0) Answers

trying to incorporate search in graph

I am trying to display statistics on a graph of students marks, the user will first need to enter the student number then according to the student number it must retrieve the marks and display on the graph, i reached a bit of a jam with the matching ...
more »

2016-11-09 20:11 (0) Answers

Show graphs in Solr client web interface

My search query comprises of more than one fields like search string, date field and a one optional field. I need to represent these on the web interface to users. Secondly, I need to represent the search data in graphical format (month wise popu...
more »

2016-11-08 15:11 (0) Answers

2D array of characters formatting

So i am writing a program where i have to read from a file that contains coordinate points and then display the plot. For instance, i have this as the first line, 20 10. What my program should do, is plot this using a 2D array of characters. An 'X' i...
more »

2016-10-31 20:10 (2) Answers

How to rotate legend symbols in ggplot2?

Consider for example this plot using the data mtcars and the function coord_flip library(ggplot2) library(Hmisc) ggplot(mtcars,aes(x=gear,y=cyl)) + stat_summary(aes(color=as.factor(rep(1:2,16))), fun.data=mean_cl_boot, position=position_dodge(0.4))...
more »

2016-10-25 01:10 (2) Answers

Stacked bar graph with variable width elements?

In Tableau I'm used to making graphs like the one below. It has for each day (or some other discrete variable), a stacked bar of categories of different colours, heights and widths. You can imagine the categories to be different advertisements that ...
more »

2016-09-13 19:09 (2) Answers

Radial tree graph layout: fix beizer curves

i want to render nice radial tree layout and a bit stumbled with curved edges. The problem is that with different angles between source and target points the edges are drawn differently. Provided pics are from the single graph so you can see how they...
more »

2016-08-21 11:08 (1) Answers

How to query Titan Graph Database from iOS App

If I set up a graph-database with an AWS DynamoDB backend using the Titan plug-in, how do I then actually send queries to the database and return values? From this Diagram that I found here, it looks like the TinkerPop API can be used to send these q...
more »

2016-08-06 03:08 (1) Answers

Bidirectional search implementation for graph

Trying to implement Bidirectional search for graph, but failed many times to do it. As I understand I should somehow merge 2 Breadth First Searches for "Start" and "End" vertexes. Base case will be when both searhes found the same vertex. Could you...
more »

2016-07-30 15:07 (0) Answers