DEV Community

Rishal Hurbans
Rishal Hurbans

Posted on

Search and data structures

Remember our search algorithm trip to the beach? If not check out this previous article: https://rhurbans.com/plan-search-repeat. Our trip can be represented as a graph. What's a graph? It's a data structure used by algorithms to do smart things.

Alt Text

Alt Text

Data structures are concepts in computer science used to represent data in a way that is suitable for efficient processing by algorithms. A data structure is an abstract data type consisting of data and operations organized in a specific way.

Alt Text

An example of a data structure is an array, which is simply a collection of data. Different types of arrays have different properties that make them efficient for different purposes.

A graph is a data structure containing several states with connections among them. Each state in a graph is called a node (or sometimes a vertex), and a connection between two states is called an edge.

Alt Text

A tree is a popular data structure that simulates a hierarchy of values or objects. A hierarchy is an arrangement of things in which a single object is related to several other objects below it.

Alt Text

A path is a sequence of nodes and edges connecting nodes that are not directly connected. A node connected to another node by following a path away from the root node is called a descendent, and by following a path toward the root node is called an ancestor.

Alt Text

It is useful to understand the different types of graphs to best describe the problem and use the most efficient algorithm for processing. Some of these categories of graphs are used in ant colony optimization algorithms and artificial neural networks.

Alt Text

If you enjoyed this and want to learn more, check out my book, Grokking Artificial Intelligence Algorithms with Manning Publications: http://bit.ly/gaia-book, consider following me for more, or join my mailing list for infrequent knowledge drops in your inbox: https://rhurbans.com/subscribe.

Latest comments (0)