Optimization/Constraint Solving on Graphs

65 Views Asked by At

I play video games, and it sounded like a fun exercise to try to find the optimal order in which to complete quests:

  • There exist multiple quest trees
  • There are some quests with inter-dependencies between the trees
  • The goal is to complete the quests in the minimum number of map visits possible

For instance, given the following:

Giver 1:
- Quest A (Map 2)

Giver 2:
- Quest A (Map 1)
  - Quest B (Map 2)
  - Quest C (Map 2)

It would make the most sense to do Giver 2, Quest A initially, so that 3 quests could then be completed in a single map visit to Map 2.

      (Map 1)
         |
Giver 2, Quest A
  /      |     \
 /    (Map 2)   \
/        |       \
G1,QA  G2,QB    G2,QC

I have no formal mathematics background, so it has been difficult for me to find the right terms to search to write an implementation.

I believe that it's some variant of optimization on directed graphs, but I couldn't say for sure. Something about cost-minimization of the "map visits" variable and some kind of sorting + weighting I would guess?

Would anyone be willing to provide more input on how to go about this/what to research?

Thank you.