What algorithm can I use to find the shortest path between specified node types in a graph?

后端 未结 8 1831
自闭症患者
自闭症患者 2021-02-14 12:19

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

8条回答
  •  误落风尘
    2021-02-14 12:29

    As far as I understand your question you need a shortest path in a directed graph. http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm should give you an idea.

    regards, Jan

提交回复
热议问题