Basic Graph Types

Explore various types of graphs such as weighted graphs, directed graphs, directed acyclical graphs (DAGs), and trees.

Let’s explore various types of graphs and the differences between them.

Weighted graphs

As we know, a graph is made of nodes and edges. Usually, the type of edge we’re dealing with changes the kind of graph we’re working with.

Let’s start by analyzing a scenario. Let’s say that someone has three friends, but their level of friendship is not the same for everyone. Maybe one is their best friend, and the other two are just good friends from work.

In that case, the connection node X for each one of them is going to be different. In this case, we say that the edge that connects X to them is weighted, creating a weighted graph such as shown below:

Get hands-on with 1400+ tech skills courses.