betterenvi / gSpan

Python implementation of frequent subgraph mining algorithm gSpan. Directed graphs are supported.
https://pypi.org/project/gspan-mining/
MIT License
194 stars 90 forks source link

Directed graph not discovered #27

Open nnfm58 opened 6 months ago

nnfm58 commented 6 months ago

I would like to point out that some directed graphs are not being discovered by the algorithm. Input example:

t # 0 v 0 2 v 1 1 v 2 3 e 0 1 1 e 2 0 2 t # -1

With a support =1, the algorithm outputs as frequent the subgraphs with 2 vertices but the algorithm seems not to generate the candidate with 3 vertices. Is there something I am missing? The following is the code's output:

t # 0 v 0 2 v 1 1 e 0 1 1

t # 1 v 0 3 v 1 2 e 0 1 2

Thanks in advance for your time.

m1zhangjh commented 3 months ago

I found the same problem. If the directed edge's frm.vlb > to.vlb, the subgraph mining does not consider it in get_forward_XXX_edges

nnfm58 commented 2 weeks ago

did you find a solution?