Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
0 answers
75 views

Imagine you get sequence of integers: [a1 a2 a3 ... an] where: 1 <= a <= 10^6 1 <= n <= 10^6 You are given a function f(x) that can change a number to the closest lower prime number, or ...
ToridFartFart's user avatar
-3 votes
1 answer
122 views

While working in LeetCode 675, I came across a weird behavior with PriorityQueue Comparator that I can't explain. For brevity, I'll state the gist of the problem statement; interested parties can read ...
Abhijit Sarkar's user avatar
5 votes
1 answer
80 views

It is alleged that the standard BFS can be extended to output all possible shortest paths between two given vertices in a directed unweighted graph (without loops? it does not seem to matter whether ...
user688486's user avatar
5 votes
2 answers
152 views

In a multi-branch game, there are 𝑛 possible endings. You can think of it as a directed tree with 𝑛 leaf nodes, where each edge has a weight of 1. Instead of playing through the entire game to reach ...
SuohTheBest L's user avatar
-1 votes
1 answer
104 views

class Solution { class City{ int city; long time; City(int c, long t){ city = c; time = t; } } public int countPaths(int n, int[][] ...
Silent Prime's user avatar
1 vote
2 answers
179 views

From "Montreal" as the origin point, I'm trying to find the shortest path to go to another city. But I'm having difficulty when a city is looped. demo at db<>fiddle create table ...
NoobAtProgramming's user avatar
0 votes
1 answer
53 views

R user learning Python here. I have an undirected unweighted edgelist and I want a distance matrix, showing the shortest path between all my nodes. There are about 30000 nodes and 40000 edges, and my ...
EmilA's user avatar
  • 179
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
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
1 vote
1 answer
165 views

Context: I want to write an algorithm for finding the shortest(least cost) path from a fixed source to a fixed destination node in a weighted directed graph with non negative weights (can have cycles)....
Lupin's user avatar
  • 59
0 votes
1 answer
137 views

Using A star algorithm, it is easy to calculate the shortest path from the source point to target point. What if we add the constraint of necessary points? How to solve it ? necessary points is a set ...
Hee's user avatar
  • 9
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
4 votes
1 answer
307 views

TL;DR How to convert a geodataframe of LineStrings to a Complete Graph with NetworkX? I have a geodataframe of a collection of linestrings that geographically represent a road network (purple). I have ...
Lord_Verulam's user avatar
0 votes
3 answers
171 views

I'm currently working for a project with TOP and I'm asked to find the shortest path between 2 squares with a Knight on a 8x8 chessboard. Imagine I want to go from 0,0 to 7,7, my algo need to return ...
Hachounet's user avatar
0 votes
0 answers
43 views

I was given a problem that in a connected, weighted graph G = (N, A), find a connected subgraph G_s = (N_s, A_s), where |N_s| <= l and A_s = {(i, j): i \in N_s, j \in N_s, (i, j) \in A}, such that ...
Chao Wang's user avatar
1 vote
0 answers
55 views

I have a large (~10 million edges and some ~100k nodes) Directed Acyclic Graph (DAG) and a list of walkers (around ~30k), and each of these walker has an origin and destination node which get ...
Alessandro Zanoli'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
0 votes
1 answer
101 views

the time complexity of dijkstra algorithm is O((V + E) logV) if my graph is E < V like the image I attached below can I drop the E and simplify it to O(VlogV)? If can, I would like to know why the ...
codeNewBie's user avatar
0 votes
1 answer
85 views

I'm learning a basic shortest-route algorithm specifically Floyd–Warshall algorithm. I understood how efficient it is when finding 'All to All' distance. But while reading a code from the book I'm ...
Asios's user avatar
  • 33
0 votes
0 answers
39 views

2d ware house layout in 2d layout task is to find shortest distance for getting material from storage points Z00 ,Z01 .... may be start or end points based on user input A1A1 B1A1 ....are storage ...
Kapil Mane Deshmukh's user avatar
0 votes
1 answer
123 views

I created a map of city in Neo4j using OpenStreetMap and OpenAddresses data. I want to find the shortest path from one address to another. The problem is that, when I'm using function apoc.algo....
strzelaczbramek9's user avatar
0 votes
0 answers
110 views

I am working on this program that reads a file of metro stations and converts it into a graph. Then it does the following tasks: • It identifies all the stations belonging on the same line of a given ...
metsys's user avatar
  • 13
0 votes
1 answer
337 views

I have been using Boost to find the shortest paths (SP) between two nodes in a graph using their implementation of Dijkstra's shortest path algorithm dijkstra_shortest_paths. This function returns a ...
Robert Benassai's user avatar
0 votes
0 answers
40 views

I have implemented a dijkstra algorithm that calculates the shortest distance for every node from the start node, but I am not able to retrieve the shortest path for these nodes. I watched a youtube ...
Abdelrahman Emara's user avatar
1 vote
1 answer
128 views

Context Given a certain KG with the following structure <distanceTo:1> <weight> 3 . <distanceTo:1> <weight> 4 . <a> ...
Ramshell's user avatar

1
2 3 4 5
40