Skip to content

there is a bug in LDAG.py #1

Description

@guinao

Hi, I have been working on Influence Maximization under LT model these days. Your codes help me a lot on understanding these algorithms and test my program. After these days' effort, I find that the function tsort in the file influence-maximizaton/LT/LDAG.py might be wrong. For the following codes, the output is [0, 1, 3, 3, 4, 4, 5] while there shouldn't be dunplicate elements in topological sort.
D = nx.DiGraph()
D.add_edge(1, 0, weight=1)
D.add_edge(3, 0, weight=1)
D.add_edge(3, 1, weight=1)
D.add_edge(4, 1, weight=1)
D.add_edge(4, 3, weight=1)
D.add_edge(5, 3, weight=1)
print tsort(D, 0, reach='in')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions