Computer scienceAlgorithms and Data StructuresData structuresGraphsGraphs: basics

Nodes, cycles and paths

Paths

Report a typo

Given below is a directed graph:

Paths in the undirected graph

Let's say that the length of a path is the number of nodes in this path (including the start and the end nodes). What are the shortest and the longest simple paths between the nodes 00 and 66?

Print the answers in the field below. The expected output format is the following:

0 2 1 5
0 4 3 1 5

The first line corresponds to the shortest path, and the second one represents the longest path.

Enter a short text
___

Create a free account to access the full topic