All Questions
4,925
questions
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 ...
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 ...
-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, פונקציית ...
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),...
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 "...
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 ...
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)....
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 ...
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 ...
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 ...
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 ...
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(...
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 ...
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 ...
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 ...