Ejemplo n.º 1
0
        private SimpleGraph CreateRandomBigGraph(Random random, int numNodes, double edgeProbability = 0.5)
        {
            var nodeRange = Enumerable.Range(0, numNodes);
            var edges     = SimpleGraph
                            .Product(nodeRange, nodeRange)
                            .Except(IdentityRelation(numNodes))
                            .Where(e => random.NextDouble() <= edgeProbability)
                            .ToList();

            return(new SimpleGraph(numNodes, edges));
        }