orhankislal commented on a change in pull request #486: Graph: Filter out
infinite paths
URL: https://github.com/apache/madlib/pull/486#discussion_r390653279
##########
File path: src/ports/postgres/modules/graph/measures.py_in
##########
@@ -184,10 +184,7 @@ class Graph(object):
-- Filtering 'Infinity' occurs in CASE instead of WHERE clause
-- so that the edge is part of the average value i.e. part of
-- the count of paths but zero addition to sum of distances.
- AVG(CASE WHEN {e.weight} = 'Infinity'::double precision
- THEN 0::double precision
- ELSE {e.weight}::double precision
- END) as avg_path_length
+ AVG({e.weight}::double precision) as avg_path_length
Review comment:
Yes. The number and/or size of components are irrelevant, we just look at
every non-infinite path and take the average.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services