dijkstra

About Dijkstra's paper

I am reading Coders at Work. I came across this paragraph in Donald Knuth's interview. Seibel: It seems a lot of the people I’ve talked to had direct access to a machine when they were starting out. Yet Dijkstra has a paper I’m sure you’re familiar with, where he basically says we shouldn’t let computer-science students touch a mach...

dijkstra's algorithm - in c++ ?

Hi, for the past four days I am trying to understand the dijkstra's algorithm. But I can't. I have a vector of points. From that I created a cost matrix. But I don't know how to make the dijkstra's algorithm. Sources are available in net, but I am not from Computer science background, So I can't understand them. I am trying to make a f...

is it worth to trim a graph as desired before applying a Dijkstra algorithm on that?

I am using Dijkstra algorithm in a program.suppose i have a graph with vertices and edges.if we imaging all the edges starting from source vertex "a" are as below a-->b a-->c and a-->d and all the edges ending to vertex "f" are : b-->f m-->f e-->f w-->f what i need is i know from beginning that i want the edge a-->b as my starting edg...

Bus public transport algorithm

I am working on a offline C# application that can find bus routes. I can extract the timetable/bus/route data. I am searching for the most simple solution that will work with basic data. What algorithm can be used to find a route from bus stop "A" to bus stop "B"? Is there a open-source solution ready for C#/Java? Is the google GTFS ...

Dijkstra on adjacency matrix in C

Hi all, I need some help with Dijkstra's algorithm in C. I've generated my adjacency matrix, that looks something like: int mat[NB][NB] = {{0, 171, MAX, 132, [...]}, {171, 0, 30, 39, [...]}, , [...]}; I've found this implementation: http://www.answers.com/topic/dijkstra-s-algorithm-1 but the path is an 1-dimensional array and my ma...

Does dijkstras algorithm relax the edges of the shortest path in order?

In "Introduction to algorithms, 3rd edition" exercise 24.3-5 wants an example that this is wrong (not always true). Is that possible? In my mind this is impossible because every edge is relaxed at a time when the path to the current vertice is already decided. Word for word: Professor N. claims to have a proof of correctness of Dijk...

how to use Dijkstra c++ code using array based version

I need to use (not implement) an array based version of Dijkstras algo .The task is that given a set of line segments(obstacles) and start/end points I have to find and draw the shortest path from start/end point.I have done the calculating part etc..but dont know how to use dijkstras with my code.My code is as follows class Point { pub...

Why use Dijkstra's if Breadth First Search can do the same and fast ?

Hello Both can be used to find the shortest path from single source. BFS runs in O(E+V) while Dijkstra's runs in O((V+E)*log(V)) But I've seen Dijkstra used a lot like in routing protocols ...

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 ...