// Copyright (c) 2016, 2020 Kiel University and others.
// Copyright (c) 2026 The elk-go Authors.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0.
//
// SPDX-License-Identifier: EPL-2.0

package intermediate

import (
	

	basegraph 
	
)

// ProcessSemiInteractiveCrossing derives pairwise in-layer constraints from
// explicitly supplied node positions while leaving dummy nodes unconstrained.
func ( *layered.LGraphArena,  layered.LGraphID) {
	 := false
	for ,  := range .Graph().Layers {
		 := make([]layered.LNodeID, 0)
		for ,  := range .Layer().Nodes {
			 := .Node()
			if .Type == layered.NormalNode && basegraph.Has(&.Properties, layered.PositionOption) {
				 = append(, )
			}
		}
		sort.SliceStable(, func(,  int) bool {
			 := basegraph.Get(&.Node([]).Properties, layered.PositionOption)
			 := basegraph.Get(&.Node([]).Properties, layered.PositionOption)
			return .Y < .Y
		})
		for  := 1;  < len(); ++ {
			 := [-1]
			 := basegraph.Get(&.Node().Properties, layered.InLayerSuccessorConstraints)
			 = append(, [])
			basegraph.Set(&.Node().Properties, layered.InLayerSuccessorConstraints, )
		}
		// Stream.reduce returns a present Optional even for a single node.
		 =  || len() > 0
	}
	if  {
		basegraph.Set(&.Graph().Properties,
			layered.InLayerSuccessorConstraintsBetweenNonDummies, true)
	}
}