Graph Implementation

This lesson will cover the implementation of a directed graph via adjacency list in Python.

Introduction

At this point, we’ve understood the theoretical concepts of graphs. Our graph will be directed and have no bidirectional edges.

The implementation will be based on the adjacency list model. The linked list class we created earlier will be used to represent adjacent vertices.

As a refresher, here is the illustration of the graph we’ll be producing using an adjacency list:

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy