示例#1
0
        public void CalculateAndWritePageRanks(short[][] links, short[][] citations, float c, string sourcePath)
        {
            PageRankCalculator prc = new PageRankCalculator(links, citations, c);

            ranks = prc.CalculateRanks();
            prc.WriteRanksToFile(sourcePath);
        }
示例#2
0
        public void TestRanks()
        {
            short[][] links = new short[4][];
            links[0] = new short[1] {
                2
            };
            links[1] = new short[1] {
                2
            };
            links[2] = new short[1] {
                3
            };
            links[3] = new short[2] {
                0, 1
            };
            short[][] citations = new short[4][];
            citations[0] = new short[1] {
                3
            };
            citations[1] = new short[1] {
                3
            };
            citations[2] = new short[2] {
                0, 1
            };
            citations[3] = new short[1] {
                2
            };

            i.PageRankCalculator prc = new i.PageRankCalculator(links, citations, 0.8f);
            float[] ranks            = prc.CalculateRanks();
            for (int i = 0; i < ranks.Length; i++)
            {
                Console.WriteLine(i + " " + ranks[i]);
            }
        }