private List <Entrance> CreateEntrancesAlongEdge(
            int startPoint,
            int endPoint,
            Cluster precedentCluster,
            Cluster currentCluster,
            ref int currentEntranceId,
            Func <int, Tuple <ConcreteNode, ConcreteNode> > getNodesInEdge,
            Orientation orientation)
        {
            List <Entrance> entrances = new List <Entrance>();

            for (var entranceStart = startPoint; entranceStart <= endPoint; entranceStart++)
            {
                var size = GetEntranceSize(entranceStart, endPoint, getNodesInEdge);

                var entranceEnd = entranceStart + size - 1;
                if (size == 0)
                {
                    continue;
                }

                if (_entranceStyle == EntranceStyle.EndEntrance && size > MAX_ENTRANCE_WIDTH)
                {
                    var nodes    = getNodesInEdge(entranceStart);
                    var srcNode  = nodes.Item1;
                    var destNode = nodes.Item2;

                    var entrance1 = new Entrance(Id <Entrance> .From(currentEntranceId), precedentCluster, currentCluster, srcNode, destNode, orientation);

                    currentEntranceId++;

                    nodes    = getNodesInEdge(entranceEnd);
                    srcNode  = nodes.Item1;
                    destNode = nodes.Item2;

                    var entrance2 = new Entrance(Id <Entrance> .From(currentEntranceId), precedentCluster, currentCluster, srcNode, destNode, orientation);

                    currentEntranceId++;

                    entrances.Add(entrance1);
                    entrances.Add(entrance2);
                }
                else
                {
                    var nodes    = getNodesInEdge((entranceEnd + entranceStart) / 2);
                    var srcNode  = nodes.Item1;
                    var destNode = nodes.Item2;

                    var entrance = new Entrance(Id <Entrance> .From(currentEntranceId), precedentCluster, currentCluster, srcNode, destNode, orientation);

                    currentEntranceId++;
                    entrances.Add(entrance);
                }

                entranceStart = entranceEnd;
            }

            return(entrances);
        }
        private void CreateEntranceEdges(Entrance entrance, AbsType type)
        {
            var level = entrance.GetEntranceLevel(_clusterSize, _maxLevel);

            var srcAbstractNodeId  = _hierarchicalMap.ConcreteNodeIdToAbstractNodeIdMap[entrance.SrcNode.NodeId];
            var destAbstractNodeId = _hierarchicalMap.ConcreteNodeIdToAbstractNodeIdMap[entrance.DestNode.NodeId];

            var orientation = entrance.Orientation;
            int cost        = Constants.COST_ONE;

            switch (type)
            {
            case AbsType.ABSTRACT_TILE:
            case AbsType.ABSTRACT_OCTILE_UNICOST:
                // Inter-edges: cost 1
                cost = Constants.COST_ONE;
                break;

            case AbsType.ABSTRACT_OCTILE:
            {
                int unitCost;
                switch (orientation)
                {
                case Orientation.Horizontal:
                case Orientation.Vertical:
                    unitCost = Constants.COST_ONE;
                    break;

                case Orientation.Hdiag2:
                case Orientation.Hdiag1:
                case Orientation.Vdiag1:
                case Orientation.Vdiag2:
                    unitCost = (Constants.COST_ONE * 34) / 24;
                    break;

                default:
                    unitCost = -1;
                    break;
                }

                cost = unitCost;
            }
            break;
            }

            _hierarchicalMap.AbstractGraph.AddEdge(srcAbstractNodeId, destAbstractNodeId, new AbstractEdgeInfo(cost, level, true));
            _hierarchicalMap.AbstractGraph.AddEdge(destAbstractNodeId, srcAbstractNodeId, new AbstractEdgeInfo(cost, level, true));
        }