예제 #1
0
        /// <summary>
        /// Split a RoadNetwork into two paritions by repeatedly breaking one edge along
        /// the shortest path between the start and end until the start and end are
        /// no longer connected.
        /// </summary>
        /// <param name="network">The RoadNetwork to split</param>
        public static void Cut(RoadNetwork network)
        {
            network.SetBroken(false);

            List<Edge> edges;
            while ((edges = network.FindPath()) != null)
            {
                edges[random.Next(edges.Count)].Broken = true;
            }
        }