7.3.1 Graphs

Graphs are a more flexible, abstract data structure that can be used for many different applications. They are similar to linked lists in that they both use nodes. While a linked list connects nodes in a sequence, graphs connect nodes in any order and can have any number of connections.

With any number of nodes and no restrictions on connections, graphs can be very useful for applications such as:

Airline Routes: Airline routes Source:By Cassiopeia sweet at Japanese Wikipedia - Based on 2000px-US_Locator_Blank2.svg.png(File:US Locator Blank2.svg), CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=14981047

Flow Charts: Airline routes Source: By svg by Booyabazookaoriginal png by Wapcaplet - vector version of Image:LampFlowchart.png, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=714537

Social Networks: Airline routes Source: By Martin Grandjean - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=39967994

Graphs can get very complex to implement and use. In this lesson, you are going to explore the basic application of graphs and how they can be used.

Last updated