我正在设计一个计算商业集装箱最佳运输路线的系统。
因此,容器通常采用的路径是:
皮卡 -> 装货港 -> 目的地港 -> 交付
我已经编制了一个已知地点的清单,可以从这些地点(如城市)和港口的清单,以及这些港口之间的联系。
在这里可以看到数据的样本。

在寻找、奥斯汀、->、法兰克福、之间的路由时,图应该只返回以下路径:
奥斯丁->,纽约->港,纽约港,->港,伦敦港,汉堡港,->Frankfurt被排除在外,因为它有两个国际步骤
例如,图还返回往返行程(不应该返回)。
奥斯汀,->,佛罗里达,->,佛罗里达港,->,汉堡,->,柏林,->,汉堡,->,法兰克福
到目前为止,我已经编写了以下gremlin查询
g.V(*from_vertices)
.repeat(
outE()
.has("ff_id", within(ff_id, "ANY"))
.has("quote_methods", containing(quote_method.value))
.has("valid_to", gte(current_date))
.has("valid_from", lte(current_date))
.in_v()
)
.until(hasId(within(*to_vertices)))
.path()
.as_("p")
.map(unfold().coalesce(values("international_stops"), constant(0)).sum_())
.as_("international_stops")
.filter_(select("international_stops").is_(lte(1)))
.select("p")
.map(unfold().coalesce(values("pricing_document_ids"), constant("")).fold())
.to_list()我面临两个问题:
图中的
https://stackoverflow.com/questions/74345499
复制相似问题