public static function getConnections($type, $otherRole, $otherType, $hierarchyType='all') {
    $paths = [];
    self::getConnectionsImpl($type, $otherRole, $otherType, $hierarchyType, $paths);
    $minLength = -1;
    $shortestPaths = [];
    foreach ($paths as $curPath) {
      $curLength = $curPath->getPathLength();
      if ($minLength == -1 || $minLength > $curLength) {
        $minLength = $curLength;
        $shortestPaths = [$curPath];
      }
      elseif ($curLength == $minLength) {
        $shortestPaths[] = $curPath;
      }
    }
    return $shortestPaths;
  }