path_analysis.py 783 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from deconvolution.lcpgraph.lcp_graph import LcpGraph
from deconvolution.lcpgraph.lcp_path_ordering import lcpord_from_connex_lcpg
from deconvolution.main.evaluate import compute_shortest_edit_path


def heat_path(order):
    heatpath = [0]*len(order.idxs_to_lcps)
    for idx, lcp in order.idxs_to_lcps.items():
        heatpath[idx] = order.neighborhood_score(lcp)

    return heatpath


def main():
    lcpg = LcpGraph()
    lcpg.load("snake_experiments/simu_0_bar_n500_d10_m2-dev0_lcpg_reduced_orderpath442073.gexf")
    order = lcpord_from_connex_lcpg(lcpg, neighbor_size_threshold=1, existing_path=True)
    path = order.to_path(lcpg)
    path_graph = path.to_lcpg()
    sep = compute_shortest_edit_path(path_graph)
    print(len(sep))



if __name__ == "__main__":
    main()