Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
5 views

Traverse a graph with multiple stops from a starting point? [duplicate]

I have an undirected weighted graph I need to traverse from X node to a list of nodes. The list is unordered by default, meaning that the order of which nodes are traversed is not important. What's ...
hesoyam's user avatar
2 votes
1 answer
66 views

Having issues calculating APSP for matrix size n >= 4

I'm having issues finding the problem with the following implementation of Floyd-Warshall APSP Algorithm. Currently working on a vjudge exercise and I'm having issues figuring out what's the problem ...
str8's user avatar
  • 23
-1 votes
0 answers
17 views

how to find the Minimum Spanning Tree on graph like that? [closed]

enter image description here i think that this quastion have a liniar complexity solution ; i will addd the algorithm of procedure Prim(G, w): input: גרף G עם קבוצת צמתים V וקבוצת קשתות E, פונקציית ...
Yasmeen Phone's user avatar
2 votes
0 answers
55 views

Most efficient way of determining if a subgraph of a graph is connected

Suppose I have a graph given by a Laplacian matrix $L$ corresponding to a regular discretization of $[0,1]^2$, meaning nodes $I={(i,j),\quad i,j=1,\dots,n}$ are connected with $(i+1,j),(i,j+1),(i-1,j),...
Aner's user avatar
  • 131
1 vote
2 answers
49 views

Graph traversal algorithm: when it is possible to move to the next node only after having visited it earlier with all incoming edges of the graph

There is a graph that consists of vertices (industrial installations) and edges flows of raw materials, intermediates and products between this nodes. I need some kind of algorithm for "...
Yura's user avatar
  • 9
2 votes
1 answer
82 views

Modified Dijkstra - Time Complexity?

I am solving the Leetcode Problem 787. Cheapest Flights Within K Stops. Basically this is single source shortest path, but with max k steps allowed. So, we can't use normal Dijkstra algorithm, where ...
Lupin's user avatar
  • 59
1 vote
1 answer
94 views

Single Source - Single Destination Shortest Path (DFS + DP) - Time complexity?

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
2 votes
2 answers
97 views

Linear time algorithm for computing radius of membership hyper-sphere

We are given a Graph, G(V, E), where V is the node set and E is the edge set consisting of ordered tuples (u, v). The graph is undirected, as such, if (u,v) is in E, then (v, u) is in E. Alongside the ...
moe asal's user avatar
  • 542
1 vote
1 answer
71 views

How to compute the start time of all the jobs?

I was recently given this coding question in a mock interview and I couldn't do it. How should you do it? You are given a connected DAG where each node corresponds to a job. Each job lasts for a ...
Simd's user avatar
  • 20.9k
1 vote
0 answers
31 views

How to use METIS to partition directed graph with edge weights?

I have a directed graph which also havs multiple edges between same nodes.I want to partition the graph using the metis algorithm. According to metis manual, metis can only generate partitions for ...
shadow's user avatar
  • 107
1 vote
1 answer
86 views

Dijkstra's algorithm vs Viterbi algorithm

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
50 views

Travel from city 1 to city n, visiting at least 3 odd cities

Problem: Find the minimum cost path from city 1 to city n visiting at least 3 odd cities, only moving forward. It costs c[i][j] to go from i to j. I have to solve this defining search problem class(...
Murad Aliyev's user avatar
0 votes
1 answer
34 views

Why is the time complexity of bidirectional bfs still O(V+E)?

I understand that if the branching factor of the graph is b and distance of goal vertex from source is d, then the time complexity is O(b^d). I also understand why that would be O(b^d/2) using ...
Shisui's user avatar
  • 1,120
0 votes
3 answers
53 views

How to extract outline of a grid-like plot when you have information about the lines?

I am trying to get the outline of a plot that looks like this: As you can see I have information about not only the points but the lines so I basically want to have all the inner lines removed. I ...
user25605486's user avatar
1 vote
2 answers
44 views

Kruskal's algorithm including a specific edge

I'm trying to solve the following question in which I have to find a list of critical edges and pseudocritical edges. From my understanding of the problem, critical edges are edges that must be ...
S10000's user avatar
  • 193

15 30 50 per page
1
2 3 4 5
329