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')
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')