简体   繁体   English

具有双向加权边的图上的路径生成

[英]Path generation on a graph with bidirectional weighted edges

I am trying to do a Java implementation of a path generator on a graph with bidirectional weighted edges.我正在尝试在具有双向加权边的图形上执行路径生成器的 Java 实现。 The problem consists on give a route to the user based on a list of points of interest (POI) and on the user interests.问题在于根据兴趣点 (POI) 列表和用户兴趣为用户提供路线。 The user interests, distances and travel time between all POI are already calculated.已经计算了所有 POI 之间的用户兴趣、距离和旅行时间。 With these data I was able to create a graph with bidirectional edges where the edge's weight is the travel time between a source and a destination node.使用这些数据,我能够创建一个具有双向边的图,其中边的权重是源节点和目标节点之间的旅行时间。

There are some relevant user inputs:有一些相关的用户输入:

  • the time span in which he wants to travel, ie 30 June at 4 pm to 30 June at 8 pm他想要旅行的时间跨度,即 6 月 30 日下午 4 点到 6 月 30 日晚上 8 点
  • the starting point (coordinates) of the trip, from where the closest POI is chosen as the trip starting point.行程的起点(坐标),从中选择最近的 POI 作为行程起点。

As the weight of the nodes is the travel time between the POI, the result path weight sum can not exceed the time span defined by the user.由于节点的权重是POI之间的行程时间,因此结果路径权重总和不能超过用户定义的时间跨度。 This will be the stoppage condition, instead of a destination node.这将是停止条件,而不是目标节点。

The user interests on a POI are defined on a range between 0 and 5. Ideally, this variable would also be considered on the path calculation, because the user would like to visit the POI with the better score.用户对 POI 的兴趣被定义在 0 到 5 之间的范围内。理想情况下,在路径计算中也会考虑这个变量,因为用户希望以更好的分数访问 POI。

This problem was proposed in an academic context and my knowledge in this area is not so good.这个问题是在学术背景下提出的,我在这方面的知识不是很好。 If you have any suggestion of algorithm or any other idea to solve this problem in a reasonable time, I would be grateful.如果您有任何算法建议或任何其他想法可以在合理的时间内解决此问题,我将不胜感激。

Consider the following procedure:考虑以下过程:

  • While running search accumulate travel-time and interest-score在运行搜索时累积旅行时间和兴趣分数
  • Stop exploring current path if one of those conditions is met:如果满足以下条件之一,则停止探索当前路径:
    • travel-time limit exceeded超出旅行时间限制
    • All POIs visited访问过的所有兴趣点
  • Keep current path as best path if one of those conditions is met:如果满足以下条件之一,则保持当前路径为最佳路径:
    • It is the first path explored这是探索的第一个路径
    • Current path has higher interest-score than best path当前路径的兴趣得分高于最佳路径
    • Current path has the same interest-score as best path and shorter travel-time当前路径具有与最佳路径相同的兴趣得分和较短的旅行时间
  • Backtrack to explore another path回溯以探索另一条路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM