TITLE: How many possible orders can the first Los Santos missions of GTA: San Andreas be completed in?
QUESTION [6 upvotes]: This is actually a pretty interesting combinatorics problem, as there's several different branches in the mission tree that split off and join together, and of course there are prerequisites for each mission. Essentially what I'm wondering is - how many possible ways are there to get from Nines And AK's to Reuniting The Families? I attached a screenshot of that part of the mission tree for reference. LOS SANTOS MISSION TREE
NOTE: For those who have never played the game, ALL missions in the ENTIRE tree must be completed before Reuniting The Families. Each line coming from the bottom of a box leads to the mission(s) that are unlocked after that one, and each line from the top of a box leads to the mission(s) that must be completed before it.

REPLY [5 votes]: While it’s true that the calculation would have been easier if “Burning Desire” weren’t a prerequisite for “Doberman”, that doesn’t mean we have to resort to brute force. We can correct for this in a few steps.
As Misha Lavrov noted, the number of orders without this constraint would have been
$$
\binom42\binom96\binom31\binom83\binom{19}9=7821830016\;.
$$
From this we have to subtract the number of orders in which “Doberman” precedes “Burning Desire”. We can visualize this in the graph by removing the line from “Burning Desire” to “Doberman” and instead adding a line from “Doberman” to “Burning Desire”. The resulting graph is again almost a series-parallel graph, but again there’s one prerequisite that messes things up – in this case it’s the constraint that “Madd Dogg’s Rhymes” comes before “Burning Desire”.
So we use the same approach again and first count without satisfying that constraint; the result is
$$
\binom74\binom31\binom51\binom{10}3\binom{19}{11}=4761666000\;.
$$
So we have to subtract that from the first result; but then we’ve subtracted too much because this includes orders in which “Burning Desire” comes before “Madd Dogg’s Rhymes”. So we have to remove the line from “Madd Dogg’s Rhymes” to “Burning Desire” and instead draw one from “Burning Desire” to “Madd Dogg’s Rhymes”. Now it’s the line from “Life’s a Beach” to “Madd Dogg’s Rhymes” that gets in the way. Removing that would leave “Life’s a Beach” hanging in the air, so we connect it to ”Reuniting the Families” instead. The resulting count is
$$
\binom41\binom41\binom61\binom81\binom{13}3\binom{19}5=2554066944\;.
$$
Now we have to draw a line from “Madd Dogg’s Rhymes” to “Life’s a Beach”. Now the line from “OG LOC” to “Life’s a Beach” is the problem, so we remove it, which leads to a count of
$$
\binom31\binom51\binom71\binom91\binom{14}3\binom{19}4=1333266480\;.
$$
Now we draw a line from “Life’s a Beach” to “OG LOC”, and this time the resulting graph is series-parallel – it merely has a redunant line from “Lines and AK's” to “OG LOC” that we can remove without having to compensate for it. The resulting contribution is
$$
\binom72\binom91\binom{11}1\binom{13}1\binom{18}3=22054032\;.
$$
Thus, altogether we count
$$
7821830016-(4761666000-(2554066944-(1333266480-22054032)))=4303018512
$$
different orders, in agreement with Misha Lavrov’s count.