private void updatePropagationUpWards(Collection<Demand> demandsToPropagateUp, Collection<MulticastDemand> mDemandsToPropagateUp,
Set<Link> linksAllLayersToUpdate, Set<Demand> demandsAllLayersToUpdate,
Set<MulticastDemand> mDemandsAllLayersToUpdate)
{
if (netPlan.getNumberOfLayers() > 1)
{
final Set<Pair<MulticastDemand, Node>> mDemandsAllEgressNodes = new HashSet<Pair<MulticastDemand, Node>>();
if (mDemandsToPropagateUp != null)
for (MulticastDemand md : mDemandsToPropagateUp)
for (Node n : md.getEgressNodes())
mDemandsAllEgressNodes.add(Pair.of(md, n));
final SortedSet<Link> initialUpperLinks = getUpCoupling(demandsToPropagateUp, mDemandsAllEgressNodes);
if (initialUpperLinks.isEmpty()) return;
final InterLayerPropagationGraph ipg = new InterLayerPropagationGraph(null, initialUpperLinks, null, true);
linksAllLayersToUpdate.addAll(ipg.getLinksInGraph());
demandsAllLayersToUpdate.addAll(ipg.getDemandsInGraph());
mDemandsAllLayersToUpdate.addAll(ipg.getMulticastDemandFlowsInGraph().stream().map(p -> p.getFirst()).collect(Collectors.toSet()));
}
}