fmcquillan99 commented on a change in pull request #486: Graph: Filter out
infinite paths
URL: https://github.com/apache/madlib/pull/486#discussion_r390650373
##########
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:
If you have, say, n disconnected sub-graphs of roughly the same size, this
calc is still OK, right? i.e., it just drops vertex pairs that are not
connected (infinite dist) and would calculate average path length based on
pairwise distances that are not infinite.
----------------------------------------------------------------
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