algorithm - The Widest Path Challenge - the most efficient way for finding path in Maximal Spanning Tree -


this question continuation of similar earlier asked question: find path between 2 nodes in graph, according given criteria - optimization task .

problem summary: need find best path in graph vertex vertex b, assumption, path quality calculated min value of edge weight on path , next best path that, has max min value. it's called "widest path problem".

previously needed solve problem in small graph (up 15 vertices), didn't need sophisticated algorithm , of kind peoples, have designed working algorithm. unfortunately i need redefine necessities in such way, graph can large (even 50 thousands of edges). i'm aware need find maximal spanning tree graph , obtain simple path start stop vertex in obtained mst. have decided use jgrapht library. has implemented kruskal minimum spanning tree algorithm. can obtain maximal spanning tree multiplying each edge weight (-1) , using kruskal minimal spanning tree, algorithm in library has been designed retrieving hash set of mst edges.

my question following: have obtained maximal spanning tree of graph java hashset of edges. how can find path vertex vertex b in such structure in efficient way , data structure efficient purpose? recommend me?

additionally, i'm worried such situation, graph not consistent (it may contain isolated vertices or isolated subgraphs), main condition kruskal algorithm correctness. way bypass problem?

thank or tips.

use set construct subgraph object. subclass depthfirstiterator encountervertex puts entry key v , value (whatever other endpoint of e is) map p. search depth-first sink. recover path initializing v source , looking v, p[v], p[p[v]], etc., until there no entry. pain, library authors baked fibonacciheap closestfirstiterator, otherwise class want. (heck, if don't care n log n time operation, run dijkstra on subgraph.)

kruskal's algorithm functions fine disconnected graphs. returns minimum-weight spanning forest, i.e., each connected component, minimum-weight spanning tree. can't vouch particular implementation.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -