Assuming this is a non-directed weighted graph, given a starting point S, your solution would be to pick a destination point D such that the longest path between S and D yields the maximum amount of edges touched. The longest path algorithm would have to remember the previously added edge and the weight associated with it that way it can choose a new edge to add to the longest path with a lesser weight.
Interesting problem. Longest Path is NP-Hard, which leads me to believe that sicne this is a contest problem there are certain heuristics that can be applied to the algorithm to prune the search tree. I'd be interested to see the full problem, as what you supplied is not enough to adequately solve this.