To pick the "best" course upwind, you need to understand what the wind are doing (and will do) over the course. If you can gain this knowlegde, you can pick the shortest and fastest course. Then you will have to decide how many tacks you will need to do, and compromise.

Of course, not many are able to predict what the wind will do accurately enough to win every time. Just look at what Bundy wrote in the "Tiger smack" thread.
If you want a write up on meteorology and wind strategy, you will have to buy some books as the subject is huge. Perhaps you will get some to the point answers if you can be a bit more spesific.

Myself, I find it hardest to pick the right way to go in oscilliating winds and when there are narrow channels of wind. Having incredible boatspeed and perfect manouvers helps a lot when you make a mistake <img src="http://www.catsailor.com/forums/images/graemlins/laugh.gif" alt="" />