Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
85 views

In Dijkstra’s algorithm, how do you prove that at any moment: distance[v] ≥ length(P) for shortest s → v path P where all vertices (except possibly v) are already processed (i.e., not in the priority ...
yarv's user avatar
  • 23
0 votes
1 answer
101 views

i am solving some leet code solutions. But with this hard question, i am not sure how to speed up my algorithm more. https://leetcode.com/problems/minimum-obstacle-removal-to-reach-corner/submissions/...
MaxH's user avatar
  • 75
3 votes
1 answer
70 views

Counterexample When Replacing Bellman-Ford with Dijkstra in Johnson’s Algorithm Question: I have an implementation of Johnson’s Algorithm, which modifies edge weights in a graph. Below is the ...
safaa's user avatar
  • 31
0 votes
0 answers
82 views

I am trying to program Dijkstra's algorithm in Dafny using the following classes which I programmed. The Pair<T> class: class Pair <U,V>{ var first:U var second:V constructor (x:U, ...
Norbert Horváth's user avatar
1 vote
1 answer
57 views

I am pulling my hair understanding the runtime for the naive (no heap) implementation of Dijsktra algorithm, and potentially if there is a better code for this naive implementation. The runtime ...
coderLane's user avatar
0 votes
1 answer
117 views

I want to find a shortest path in neo4j between a start and end node. The graph is weighted with properties "costs" and "transit_time". I wanna find the shortest path in terms of ...
thomaswiiswitch's user avatar
0 votes
0 answers
43 views

I am implementing a complex shortest path algorithm for large graphs in C++. This algorithm basically constructs a hierarchy of shortcut graphs by utilizing nice properties. The first step in the ...
maitrehihois's user avatar
2 votes
1 answer
103 views

I've been working on a problem where I need to find the shortest path in a graph considering two types of edge weights: normal and special. Check Problem Here. I have constructed an adjacency list and ...
Himanshu's user avatar
2 votes
1 answer
462 views

Viterbi and Dijkstra's algorithm seem to be used in different contexts: Viterbi algorithm is usually employed to solve maximum likelihood sequence problems (I've used for this purpose in ...
Rubem Pacelli's user avatar
0 votes
1 answer
307 views

I'm implementing my own version of the Bellman-Ford algorithm to find shortest paths with negative weights. However I'm not sure if this is correct, since in my opinion the complexity in my solution ...
Michel H's user avatar
  • 363
0 votes
2 answers
105 views

Is Dijkstra's algorithm the most suitable for finding the shortest distance between two nodes, where all of the paths in the graph are equal to 1. If not what is a more time efficient way of ...
Georgi Traykov's user avatar
0 votes
0 answers
58 views

I am trying to implement Dijkstra's algorithm to solve a problem for school, but I keep getting the error "Reference to distance is ambiguous". Here is my code: #include <bits/stdc++.h>...
NickWasHere's user avatar
0 votes
0 answers
53 views

I have successfully implemented a Dijkstra algorithm for finding optimal routes in road networks. I have constructed the data so that there are no "nodes", instead I use road segments, and ...
Jaska's user avatar
  • 1,440
2 votes
1 answer
615 views

Stack Overflow community! I'm working on a pathfinding problem within a 3x3 grid, where each cell has a variable cost based on its coordinates, and there are additional costs for making 90-degree ...
Mojtaba Heidari's user avatar
1 vote
0 answers
236 views

Consider postgressql 14.11 (Ubuntu 14.11-0ubuntu0.22.04.1) and the following table CREATE TABLE test_path (id INTEGER, source INTEGER, target INTEGER, cost NUMERIC); INSERT INTO test_path (id, source, ...
Riccardo Gatti's user avatar
1 vote
1 answer
152 views

the exercise: in undirected graph vertices have can have weights in addition to the weights of edges This problem is to write algorithem that finding the cheapest path between vertices a and b in a ...
CallMeDave's user avatar
1 vote
0 answers
43 views

I'm working on a personal project which basically boils down to a typical Traveling Salesman problem (frequently have to go to ~20 different locations ensuring I go to all of them in the shortest ...
Roberto Yglesias's user avatar
0 votes
0 answers
94 views

In a project at school, the teacher gave us 10 cities and their pairwise distances, and asked us to find the minimum distance from Izmir to Van but with the following restriction: You start from ...
iamsahinemir's user avatar
0 votes
0 answers
76 views

The problem I marked in the picture is choosing the shortest path for the greedy and Dijkstra algorithms, now I'm confused because there are 2 identical paths, namely B to C and B to D. Which path ...
Mks Akbar's user avatar
2 votes
1 answer
286 views

I'm solving a programming problem involving finding the shortest path between a vertex and the rest of the graph. Currently, I'm using Dijkstra's algorithm to achieve that. However, the problem ...
PhanLong's user avatar
0 votes
1 answer
593 views

In my program, I'm tasked to take the first input, node names, then depending on the count of the node names we enter x amount of lines of graphs for the matrix used to display the possible paths for ...
O Z's user avatar
  • 59
0 votes
0 answers
84 views

I am working with a undirected graph which relates some places to have fun in an amusement park. Each vertex is a place and each node gives us the distance and the average time between two places. How ...
Aarón Acuña's user avatar
1 vote
0 answers
64 views

I'm doing my first Dijkstra's algorithm problem from LeetCode and I'm struggling to understand why it's failing. I'm stuck, and I don't want to look at other implementations without understanding what'...
user22248976's user avatar
0 votes
2 answers
51 views

I am trying to solve a problem using a priority queue, where I have a two dimensional array times where indexes in the second dimension representing starting edge, ending edge, and the distance ...
Karthikeyan's user avatar
0 votes
1 answer
73 views

I meet a question, which ask me to find a path from start node to the destination node in a undirected graph, which the minimal weight along the path is larger or equal to any other path. And there ...
Julie Guo's user avatar

1
2 3 4 5
39