Such algorithm was left as an exercise to the reader in Skiena’s algorithm design book, supposedly it is just a modification of Prim’s algorithm (In his wiki reference exercise 6-11). Can anyone design such algorithm?
Such algorithm was left as an exercise to the reader in Skiena’s algorithm design
Share
Prim with a simple priority queue is O(m+n lg n), where m is the number of edges and n the number of vertices. If you bucket entries with the same priority (e.g., use linked lists) you automatically get O(m+n lg k).
AFAIK, the state of the art for this case is O(m), Fredman and Willard.