Helper function to output vertices as comma-separated list.
$paths: An array containing a list of vertices.
$keys: (optional) Whether to output the keys of $paths instead of the values.
function displayArray($paths, $keys = FALSE) {
if (!empty($paths)) {
return implode(', ', $keys ? array_keys($paths) : $paths);
}
else {
return '(empty)';
}
}