How does apt-get work?


I'm looking for some information/documentation about apt-get. Not really how
you use it, but how they developped it. I have read the building tree is a
graph to catch the dependencies? But how do you build that graph?

I downloaded the source of apt, but I can't understand it. I'm looking for
more info. Can somebody help me?