How to find a path in graph with maximum edges?

Let’s learn how to find a path in graph with maximum edges. The most accurate or helpful solution is served by stackoverflow.com.

There are ten answers to this question.

Best solution

How to find a path in graph with maximum edges? - Stack ...

In a graph I want to find a path which consists of maximum number of adjacent edges. Which algorithm should be followed. The graph edges do not contain any weight.

stackoverflow.com

Other solutions

How can I find a path of a given length between two nodes in a weighted (undirected) graph?

Given a graph, how can I find a path of length X between two nodes in the graph. The path should ideally visit an edge no more than once.

Answer:

You can use a customized version of Uniform-cost search. Use Uniform-cost search but do not keep track...

Read more

Fardad Jalili at Quora Mark as irrelevant Undo

How can i find shortest path without graph theory?

i have to write a c++ algorithm to find the shortest path of a graph. but we are not allowed to use graph theory algorithms such as Dijkstra's algorithm, etc. We were thinking ...show more

Answer:

Use the unweighted breadth-first traversal algorithm. It basically assigns a weight to each edge, starting...

Read more

BTJHGTPVD6M6MAOJDNGFAMY6ZM at Yahoo! Answers Mark as irrelevant Undo

How does this algorithm to find the edges of the min cut of a graph work?

How can I find the minimum cut on a graph using a maximum flow algorithm? The answer says that the min cut consists of the edges with reachable from vertex and unreachable to vertex. (reachability is from the source vertex) Also, do any other algorithms...

Answer:

Thanks for the A2A. First set the weight of  the graph GGedges to 1,  use ford-fulkerson or edmond-karps...

Read more

Tapas Kumar Mishra at Quora Mark as irrelevant Undo

Given a directed graph G=(V,E) and subset of vertices V', find the shortest path that visits all vertices in V' exactly once and never revisits any vertex in V.

Without the last condition, a reasonable approach would be to use Floyd-Warshall (or Dijkstra's, etc.) to precompute all pairwise shortest-path-distances for V', call these E', and use a TSP heuristic to approximate the shortest Hamiltonian path through...

Answer:

This appears to be equivalent to finding a minimum weight Hamiltonian path in the graph [math]G^{'}...

Read more

Justin Rising at Quora Mark as irrelevant Undo

In a weighted undirected graph, how do I find a fixed length path between two nodes?

I would like an algorithm or pointers to further research on how to find a fixed length path between two nodes in a weighted undirected graph.

Answer:

If your desired length is small, then the color-coding method is pretty reasonable. See Color-coding...

Read more

Aaron Schild at Quora Mark as irrelevant Undo

How can I find the shortest path between two nodes if there might be negative cycles in the graph?

I remember reading somewhere that this is a NP hard problem. But what if I add an aditional clause that guarantees that even though there might be a negative cycle in the graph, there exists a path that doesn't go through the negative cycle?

Answer:

bellman-ford algorithm

Read more

Anusha Gudladana at Quora Mark as irrelevant Undo

How to find the MST of a directed graph with vertices that has no entering edges?

eg: http://upload.wikimedia.org/wikipedia/co… what method to be followed to find the MST when there are vertices with no entering edges?

Answer:

I'm a little rusty on my CS (mostly just program now), but MST = minimus spanning tree, right? If there...

Read more

Madurang... at Yahoo! Answers Mark as irrelevant Undo

How can I find the longest simple path in a directed, not necessarily acyclic graph?

There's no start node or goal node- I want the longest contiguous path. It can begin anywhere, can end anywhere as long as the total path is the longest possible. I guess the recurrence for Dynamic Programming would be something like: ds(u,v)=max(dsâ...

Answer:

Let f(x) be the longest path ending at node x. Your recurrence is f(x) = 1 + max( f(y) ), where y are...

Read more

Steven Hao at Quora Mark as irrelevant Undo

What is an algorithm to find a longest path in a unweighted directed acyclic graph?

Note that it can be from any node to any other node. In other words, how can someone find the (maximum) diameter of a graph (unweighted and directed acyclic)?

Answer:

replacing the edge weights with  ((LCM of all edges)/(weight  of  the  edge))  makes the longest edge...

Read more

Manikanta Raju Lakkaraju at Quora Mark as irrelevant Undo

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.