calculate the critic path by giving a graph with node set, node weight value and it's predecessor list.
Firstly, to mark the rank of each node.
Then, calculate the latest start time for each node.
Lastly, calculate the earliest finish time for each node.
Get the critic path with the node whose latest start time is equal to it's earliest finish time.