Having implemented this algorithm, including a graph, from scratch, I know how ... overwhelming this can be at first.
I don't find it rather strange that one should be asking abstract questions like this.
Anyway, good luck. Hopefully it should all fall into place after you've started fleshing it out.