示例#1
0
 public static ConnectionGraph CreateUniformConnections(IEnumerable<string> strs, int connectionPerUser)
 {
     var s = strs.ToList();
     var graph = new ConnectionGraph();
     for (int i=0;i<s.Count-1;i++)
     {
         for (int j=0;j<connectionPerUser;j++)
         {
             var n = Rnd.NextInt(i + 1, s.Count);
             if (graph.IsConnected(s[i], s[n]))
                 continue;
             graph.Add(s[i], s[n]);
         }
     }
     return graph;
 }
示例#2
0
        public static ConnectionGraph CreateUniformConnections(IEnumerable <string> strs, int connectionPerUser)
        {
            var s     = strs.ToList();
            var graph = new ConnectionGraph();

            for (int i = 0; i < s.Count - 1; i++)
            {
                for (int j = 0; j < connectionPerUser; j++)
                {
                    var n = Rnd.NextInt(i + 1, s.Count);
                    if (graph.IsConnected(s[i], s[n]))
                    {
                        continue;
                    }
                    graph.Add(s[i], s[n]);
                }
            }
            return(graph);
        }
示例#3
0
文件: Blog.cs 项目: okulovsky/Saturn
 public Blog(ConnectionGraph graph)
 {
     this.graph = graph;
 }
示例#4
0
文件: Blog.cs 项目: okulovsky/Saturn
 public Blog(ConnectionGraph graph)
 {
     this.graph = graph;
 }