23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

next node to send to (on the shortest path from A to B) is C. Your program<br />

should output the rout<strong>in</strong>g table for each node <strong>in</strong> the network, given an <strong>in</strong>put list<br />

of node connectivity lists, each of which is <strong>in</strong>put <strong>in</strong> the syntax as shown above,<br />

one per l<strong>in</strong>e.<br />

Chapter Notes<br />

The depth-first search method is a part of the "folklore" of computer science, but<br />

Hopcroft <strong>and</strong> Tarjan [50, 90] are the ones who showed how useful this algorithm is<br />

for solv<strong>in</strong>g several different graph problems. Knuth [62] discusses the topological<br />

sort<strong>in</strong>g problem. The simple l<strong>in</strong>ear-time algorithm that we describe for determ<strong>in</strong><strong>in</strong>g if<br />

a directed graph is strongly connected is due to Kosaraju. The Floyd-Warshall<br />

algorithm appears <strong>in</strong> a paper by Floyd [35] <strong>and</strong> is based upon a theorem of Warshall<br />

[98]. The mark-sweep garbage collection method we describe is one of many<br />

different algorithms for perform<strong>in</strong>g garbage collection. We encourage the reader<br />

<strong>in</strong>terested <strong>in</strong> further study of garbage collection to exam<strong>in</strong>e the book by Jones [55].<br />

To learn about different algorithms for draw<strong>in</strong>g graphs, please see the book chapter<br />

by Tamassia [88], the annotated bibliography of Di Battista et al. [29], or the book by<br />

Di Battista et al. [30]. The first known m<strong>in</strong>imum spann<strong>in</strong>g tree algorithm is due to<br />

Baruvka [9], <strong>and</strong> was published <strong>in</strong> 1926. The Prim-Jarník algorithm was first<br />

published <strong>in</strong> Czech by Jarník [54] <strong>in</strong> 1930 <strong>and</strong> <strong>in</strong> English <strong>in</strong> 1957 by Prim [82].<br />

Kruskal published his m<strong>in</strong>imum spann<strong>in</strong>g tree algorithm <strong>in</strong> 1956 [65]. The reader<br />

<strong>in</strong>terested <strong>in</strong> further study of the history of the m<strong>in</strong>imum spann<strong>in</strong>g tree problem is<br />

referred to the paper by Graham <strong>and</strong> Hell [45]. The current asymptotically fastest<br />

m<strong>in</strong>imum spann<strong>in</strong>g tree algorithm is a r<strong>and</strong>omized method of Karger, Kle<strong>in</strong>, <strong>and</strong><br />

Tarjan [56] that runs <strong>in</strong> O(m) expected time.<br />

Dijkstra [31] published his s<strong>in</strong>gle-source, shortest path algorithm <strong>in</strong> 1959. The reader<br />

<strong>in</strong>terested <strong>in</strong> further study of graph algorithms is referred to the books by Ahuja,<br />

Magnanti, <strong>and</strong> Orl<strong>in</strong> [6], Cormen, Leiserson, <strong>and</strong> Rivest [25], Even [33], Gibbons<br />

[39], Mehlhorn [75], <strong>and</strong> Tarjan [91], <strong>and</strong> the book chapter by van Leeuwen [94].<br />

Incidentally, the runn<strong>in</strong>g time for the Prim-Jarník algorithm, <strong>and</strong> also that of<br />

Dijkstra's algorithm, can actually be improved to be O(n log n + m) by implement<strong>in</strong>g<br />

the queue Q with either of two more sophisticated data structures, the "Fibonacci<br />

Heap" [37] or the "Relaxed Heap" [32].<br />

882

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!