I have a undirected, weighted graph with objects of an arbitrary type as nodes. The weight of an edge between two nodes A and B is the similarity of these two nodes in the interval (0, 1]. A similarity of 0 leads to no connection between to nodes, so the graph may be partitioned.
Given a target weight w and a start-node S, which is an algorithm to find all nodes that have a weight > w. Subnodes (seen from S) should have the product of all weights on the path. I.e:
S --(0.9)-- N1 --(0.9)-- N2 --(0.6) -- N3
Starting with S the nodes will have the following similarity values:
N1: 0.9
N2: 0.9 * 0.9 = 0.81
N3: 0.9 * 0.9 * 0.6 = 0.486
So given S and the target weight 0.5 the search should return N1 and N3. Wheres a search starting from N2 would return S, N1 and N3.
Are their any algorithms that fit my needs?
note the following:
log(p1 * p2) = log(p1) + log(p2)p1 < p2thenlog(p1) < log(p2)and thus:-log(p1) > -log(p2)Claim [based on the 1,2 mentioned above]: finding the most similar route from s to t, is actually finding the minimum path from s to t, where weights are
-logof original.I suggest the following algorithm, based on Dijkstra’s algorithm and the above claim.