Prerequisites - JamesBremner/PathFinderJune2021 GitHub Wiki

This option finds paths through ordered requirements. "Before you can do B, you must have done A" See https://stackoverflow.com/questions/67646335 for details of this problem.

Input

The input is space delimited text file with three lines.

The first line must be format prerequisites

The second line specifies a tree. The first field must be 't'. The parent of node N is specified in field N+1. The root is its own parent, so field 1 always contains '0'.

The third line is a list of the required nodes. The first field must be 'a'.

Example:

format prerequisites
t 0 0 0 0 2 3 3
a 2 5 6

Specifies

alt text

image