Sorry that i forget to mention one more complexity fact above, the score of a vertex could be potentially updated due to a new path and corresponding score updating.
Sample Data:
graph = EmptyGraph.instance()
cluster = Cluster.open()
g = graph.traversal().withRemote(DriverRemoteConnection.using(cluster, "g"))
va = g.addV("model_a").property(id, "1").property("tag", "a").property("weight", 1).next()
vb = g.addV("model_a").property(id, "2").property("tag", "b").property("weight", 2).next()
vc = g.addV("model_a").property(id, "3").property("tag", "c").property("weight", 3).next()
vd = g.addV("model_a").property(id, "4").property("tag", "d").property("weight", 4).next()
ve = g.addV("model_a").property(id, "5").property("tag", "e").property("weight", 5).next()
vf = g.addV("model_a").property(id, "6").property("tag", "f").property("weight", 6).next()
vg = g.addV("model_a").property(id, "7").property("tag", "g").property("weight", 7).next()
vh = g.addV("model_a").property(id, "8").property("tag", "h").property("weight", 8).next()
vi = g.addV("model_a").property(id, "9").property("tag", "i").property("weight", 9).next()
g.addE("model_a").from(va).to(vb).property(T.id, 12).property("dis", 0.50d)
g.addE("model_a").from(va).to(vc).property(T.id, 13).property("dis", 0.95d)
g.addE("model_a").from(vb).to(vd).property(T.id, 24).property("dis", 0.10d)
g.addE("model_a").from(vb).to(vi).property(T.id, 29).property("dis", 0.99d)
g.addE("model_a").from(vc).to(vb).property(T.id, 32).property("dis", 0.10d)
g.addE("model_a").from(vc).to(vd).property(T.id, 34).property("dis", 0.95d)
g.addE("model_a").from(vc).to(ve).property(T.id, 35).property("dis", 0.75d)
g.addE("model_a").from(vc).to(vf).property(T.id, 36).property("dis", 0.10d)
g.addE("model_a").from(vc).to(vh).property(T.id, 38).property("dis", 0.95d)
g.addE("model_a").from(vd).to(vb).property(T.id, 42).property("dis", 0.95d)
g.addE("model_a").from(vd).to(ve).property(T.id, 45).property("dis", 0.95d)
g.addE("model_a").from(vd).to(vg).property(T.id, 47).property("dis", 0.65d)
g.addE("model_a").from(ve).to(vg).property(T.id, 57).property("dis", 0.85d)
g.addE("model_a").from(vh).to(vf).property(T.id, 86).property("dis", 0.90d)
Assume the score of vertex is the Setting threshold of 0.8, and score of a vertex is the max of the product of dis properties along path from any Vertex in S1 (a and c in the example) to the target vertex, i would like to a gremlin query/travasal returns following list/map.
h, 0.95
d, 0.95
b, 0.9025
e, 0.9025
i, 0.89347