Random Walks with Conditional Probability

I want to implement random walks in which the next edge to be picked is dependent on the previous edge in a trace.

For details, there is a timestamp attribute in the edges. The output traces should be in chronological order.

Currently, the graph contains 1 type of edge, with parallel directed edges. The graph is also with node attributes and edge attributes.

How can I implement this? Thank you.

I don’t think DGL has builtin support for this functionality. You will need to implement it by your own.

Thanks for your reply.

May you please give some hints on which part of scripts I should modify for this purpose?

(It seems that the built-in random walk module calls C++ based module.)

I tried to write the required scripts in Python but the computation time is too long (as compared with the DGL built-in function).

If you want to achieve similar efficiency as DGL’s builtin random walk, I’m afraid that you will need to write C++ code as well.