Dynamic Programming Shortest Path Algorithm In Cnidarians