Grid deformation in response to optimized path

Hi. All. Can anybody advise me how to achieve the attached images with grasshopper? I would like to deform the rectangular grid responding to the optimized path network. I am thinking that I need to make the path network as attractors but I don't know what is appropriate way of doing it. Please help! Thanks in advance.