The deadline for this project is closing in very quickly and I don\'t have much time to deal with what it\'s left. So, instead of looking for the best (and probably more complic
This assumes O(E log V)
is an acceptable running time, if you're doing something online, this might not be, and it would require some higher powered machinery.
Djikstra's algorithm is good for this, for one time use. You can save the result for future use, with a linear scan through all the vertices (or better yet, sort and binary search).
Might be nearly the same as above -- just use some function where the weight would be infinity if it is not of the correct relation.
Same as above, essentially, just determine early if you match the two users. (Alternatively, you can "meet in the middle", and terminate early if you find someone on both shortest path spanning tree)
Longest path is an NP-complete problem.
This is the diameter of the graph, which you can read about on Math World.
As for the adjacency list vs adjacency matrix question, it depends on how densely populated your graph is. Also, if you want to cache results, then the matrix might be the way to go.