How can I assign weights (ranging from 0 to 1.000) to vertices/edges/faces based on their topological distance from one or several vertices/edges/faces within the same mesh?

By topological distance, I am referring to the number of nodes away from the attractor vertice(s)/edge(s)/face(s).

I hope the solution is relatively fast.
Thank you!

Thank you very much! @Bernd_MĂ¶ller
I am very glad to learn the Vertex Neighbours, it is useful in solving many problems.
But what I am seeking is, that maybe I was not clear, I like to calculate the graph distance from nodes to node(Vs to V, Es to E, Fs to F), and I like to turn the quantity of the nodes between into weights.

After composing my question, I did a little bit of research. So now I am thinking it must be a graph problem. There are indeed many components in GH that show the topology of mesh/lines/points, but no one returns the distance information, so I am seeking help here.

Ah, sorry, I jumped to conclusions a bit too early
Besides the shortest path mentioned by Toni, I had to think of the heat method, see for example this thread: Heat Method - Grasshopper - McNeel Forum

If you want to follow the edges, you could use shortest path. Length is 1 for each edge and at the end you donâ€™t use the length but the number of segments.