Is there a methodology or guideline that can help me make these decisions algorithmically?
Fingering is typically arranged by musicians, and the decisions have artistic implications, so it doesn't seem like something that can be automated, at least not fully.
- Notes played on higher frets sound mellow while those played on lower frets are brighter. This affects not only the overall sound, but the continuity of the voices. E.g. if you play a melody on the high frets and play one of the notes on an open string, it may sound out of place and not blend well with the other notes.
- It is often difficult to change the fretting hand position inaudibly. Position change often results in some kind of articulation accent.
- Certain note combinations may be easier or more difficult to play in various parts of the neck. E.g. you can play F#₄ as:
E-2---
B-----
G-----
D-----
A-----
E-----
but if you want G₄ to sound simultaneously, perhaps it's better to play:
E-3---
B-7---
G-----
D-----
A-----
E-----
It would be require even less fretting hand stretch to play:
E-----
B--8--
G-11--
D-----
A-----
E-----
as the interval between G and B strings is only a major third, and because the distances between the higher frets are smaller.
- There might be various individual conditions. Guitarists with smaller hands may prefer different fingerings. Various guitarists may have different strong and weak points in their technique, or different preferences, resulting in different choices.
- In some cases harmonics allow to achieve what would be impossible otherwise.
In practice fretting hand fingering very often involves compromises. Changes of the timbre can be compensated with the plucking hand articulation, but requires a conscious decision.
In the works of good composers you will often find examples of efficient use of the instrument characteristics, and making what would seem a limitation to aid the artistic expression.
Also, consider this example of unconventional fingering (index finger on the fourth fret, middle finger on the third) in Leo Brouwer's Balada de la Doncella Enamorada:
Some guitarists prefer to finger it in a more conventional way:
If I recall correctly there is yet another way to finger this part in a way that preserves legato articulation on the A string. Which fingering is the best? That's an individual choice.