// use the selected nodes as start nodes
const startNodes = graphComponent.selection.nodes
const reachability = new Reachability({
startNodes: startNodes,
directed: true // consider edge direction
})
const reachabilityResult = reachability.run(graphComponent.graph)
// highlight the reachable nodes
reachabilityResult.reachableNodes.forEach((n: INode): void => {
graphComponent.highlights.add(n)
})