Algorithms for molecular communication networks