Mercurial > hg > Members > nobuyasu > TPPageRank
comparison src/pagerank/TPReadWikiLink.java @ 8:4d1885a2fa36 draft
fix method of calculation for computing PageRank.
author | one |
---|---|
date | Wed, 05 Sep 2012 17:19:59 +0900 |
parents | c7b139ff27e2 |
children | 9787663edb54 |
comparison
equal
deleted
inserted
replaced
7:c7b139ff27e2 | 8:4d1885a2fa36 |
---|---|
33 FileInputStream in = new FileInputStream(new File(fileDB)); | 33 FileInputStream in = new FileInputStream(new File(fileDB)); |
34 GraphMLReader.inputGraph(graph, in); | 34 GraphMLReader.inputGraph(graph, in); |
35 in.close(); | 35 in.close(); |
36 LinkToVertex ltv = new LinkToVertex(graph); | 36 LinkToVertex ltv = new LinkToVertex(graph); |
37 | 37 |
38 // ltv.initPageRankAllVertex(); | |
38 final long AllVertexNumber = ltv.searchAllVertices(); | 39 final long AllVertexNumber = ltv.searchAllVertices(); |
39 HashMap<String, WikiPage> wikiHash = ltv.getWikiPageHash(); | 40 HashMap<String, WikiPage> wikiHash = ltv.getWikiPageHash(); |
40 System.out.println("AllVertexNumber = "+AllVertexNumber); | 41 System.out.println("AllVertexNumber = "+AllVertexNumber); |
41 | 42 |
42 String nodeIds[] = {"1574", "2829", "2850", "3618"}; | 43 |
43 writeComputeTransition(ltv, nodeIds, 50); | 44 // String nodeIds[] = {"1574", "2829", "2850", "3618"}; |
44 | 45 // writeComputeTransition(ltv, nodeIds, 50); |
45 // FileOutputStream fos = new FileOutputStream(new File("./resources/wikiPageRank.log")); | 46 |
46 // descendingOrder(wikiHash, fos); | 47 |
47 | 48 FileOutputStream fos = new FileOutputStream(new File("./resources/wikiPageRank.log")); |
48 | 49 descendingOrder(wikiHash, fos); |
49 | 50 |
51 | |
50 FileOutputStream out = new FileOutputStream(new File(fileDB)); | 52 FileOutputStream out = new FileOutputStream(new File(fileDB)); |
51 GraphMLWriter.outputGraph(graph, out); | 53 GraphMLWriter.outputGraph(graph, out); |
52 out.close(); | 54 out.close(); |
53 | 55 |
54 | 56 |