Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一张美国空间地图,将城市与权重(距离)连接起来。我想在这张地图中找到最长(最加权)的路径。
不需要访问所有节点或边缘。
方法和序言资源建议会很好。
我不知道我是否正确,但您可以尝试以下方法:
您可以检查该图是否为欧拉图。如果是这样,您的问题是找到欧拉电路,这可以在多项式时间内完成。
否则你有问题,因为如果我没有错,你必须找到最大(可能是诱导的)欧拉子图,这是 NP 难的。
当然,一切都假设所有权重都是非负的。