Book Image

Learning F# Functional Data Structures and Algorithms

By : Adnan Masood
Book Image

Learning F# Functional Data Structures and Algorithms

By: Adnan Masood

Overview of this book

Table of Contents (21 chapters)
Learning F# Functional Data Structures and Algorithms
Credits
Foreword
Foreword
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 8. Quick Boost with Graph

 

I think of the company advertising "Thought Processors" or the college pretending that learning BASIC suffices or at least helps, whereas the teaching of BASIC should be rated as a criminal offence: it mutilates the mind beyond recovery.

 
 -- Dijkstra (1984) "The threats to computing science (EWD898)"

In the previous chapter, we reviewed the data structure of a queue; a custom implementation followed by throttling and post-processing the results of asynchronous calls as an example usage of a queue. Graphs are key data structures in computer science that represent relationships between a variety of objects (networks, circuits, Web, and relationship) using vertices and edges. In this chapter, we will briefly discuss how a graph can be implemented in a functional language, and why it is a rather difficult task to undertake. We will present a few commonly used graph implementations and discuss one of the most typical shortest-path graph implementation, Dijkstra...