private double CalcSubGraphWeight(int vertexId) { if (SubGraphWeight.TryGetValue(vertexId, out var weight)) { return(weight); } weight = CalcVertexScore(vertexId); foreach (var edge in SpGraph[vertexId].Edges) { // weight = weight + CalcSubGraphWeight(edge.To); weight = Math.Max(weight, CalcSubGraphWeight(edge.To)); } SubGraphWeight[vertexId] = weight; return(weight); }
public double EstimateWeight(Edge edge) { return(SubGraphWeight.TryGetValue(edge.To, out var weight) ? weight : 0); }