Consider a simple directed graph G = (V,E). A simple directed graph contains neither self-loops or multiple edges. Let us further assume that G consists of a single (weakly) connected component.
Given a subset V' of V, I would like to create another simple directed graph G' = (V',E') so that G' has an edge (u,v) if and only if there is a path (any path, not necessarily the shortest path) from u to v in G that does not contain any other vertex in V'. Clearly G' is not really a subgraph of G, but the problem seems similar. Does it have a standard solution, or do I have to roll my own?
A concrete example may make clearer what I have in mind: Given a BPMN diagram consisting only of exclusive gateways, parallel gateways, tasks, and the sequence flow between them, I would like to reduce this diagram to the raw control flow. That is, I want to take out all the tasks, so that my V' consists of just the gateways. Then I want to connect any two gateways that have a path between them in the original diagram that goes only through tasks, not through other gateways. Such a path, if it exists, may not be the only path, nor the shortest, between the two gateways in the original diagram. If there are several such paths (which will usually be the case, as every branch of an opening gateway will usually lead through several tasks to the same closing gateway), of course I want my reduced graph to contain only one edge between those gateways.