This is the problem:
I have n points (p1, p2, p3, .. pn), each of them can connect to any other with a determined cost x.
Each point belongs to one of a set of p
This is how I presently interpret your problem.
Red arrows are me manually tracing the paths that conform to the given ordering constraint.
Costs are not provided, but it is assumed all links incur a cost, and the link costs are different.
If this accurately describes the scenario you are trying to solve, please say so, so that others can better answer the question.