Graphs are among the most important abstract data types in computer science, and the algorithms that operate on them are …