It seems that this solution is only applicable to 2D directed network. How to deal with 3D directed network? Thanks a lot in advance.