Updating stAggregate algorithm to consider multiedges