Query to rank returned vertices

I could not find algorithm that suits my case. So, if anyone from community can help will be greatly appreciated :slight_smile:

Here is what I am trying to achieve.
I have multiple source vertices, with each source vertex having some importance_weightage, I want to find all the vertices from the source vertices that is of a certain type (say RETURN_VERTEX_TYPE). Max hop can be k, in my case it is 2.
In ranking function I want to use the number of source vertices that are connected to target as well.
For instance say I have 15 source vertices and in 2 hops, say I find 50 vertex of RETURN_VERTEX_TYPE. The vertices that have a path from source vertices in depth 2, should have more importance.

So, the ranking function of the return vertices should consider the following:

  • Number of Source vertices that are connected to RETURN_VERTEX_TYPE nodes in k hops.
  • importance_weightage of each vertices passed as input. Use max if multiple source connects to target.
  • edge_weight of edges

and each of these ranking parameters should be weighted too.
Ex: f() = w1*(source_vertices_count) + w2max(importance_weightage) + w3(edge_weight)

If there are any similar algorithm, please point out. Happy to explore that as well :slight_smile: