Toggle navigation
Toggle navigation
This project
Loading...
Sign in
조성현
/
graph-visualization
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
조성현
2017-06-21 18:26:49 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a30dd054fa79f58c6530f3ffc6d2529e50810e0d
a30dd054
1 parent
c35c7fc3
add pagerank
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
PaperGraph/GraphItem.cpp
PaperGraph/stdafx.h
PaperGraph/GraphItem.cpp
View file @
a30dd05
...
...
@@ -921,6 +921,7 @@ void GraphItem::test()
auto
node_citation_map
=
boost
::
get
(
vertex_citation
,
*
graph
);
auto
node_label_map
=
boost
::
get
(
vertex_name
,
*
graph
);
auto
node_type_map
=
boost
::
get
(
vertex_type
,
*
graph
);
auto
node_pagerank_map
=
boost
::
get
(
vertex_pagerank
,
*
graph
);
vertex_iterator
vi
,
vi_end
;
for
(
boost
::
tie
(
vi
,
vi_end
)
=
vertices
(
*
graph
);
vi
!=
vi_end
;
++
vi
)
{
if
(
node_type_map
[
*
vi
]
!=
NODE_TYPE
::
NODE_PAPER
)
continue
;
...
...
@@ -928,6 +929,16 @@ void GraphItem::test()
node_citation_map
[
*
vi
]);
}
//page_rank();
qDebug
(
"* pagerank start"
);
boost
::
graph
::
page_rank
(
*
graph
,
node_pagerank_map
);
for
(
boost
::
tie
(
vi
,
vi_end
)
=
vertices
(
*
graph
);
vi
!=
vi_end
;
++
vi
)
{
printf
(
"%s
\t\t
%f
\n
"
,
node_label_map
[
*
vi
].
c_str
(),
node_pagerank_map
[
*
vi
]);
}
qDebug
(
"* pagerank end"
);
qDebug
(
"* test action end"
);
}
...
...
PaperGraph/stdafx.h
View file @
a30dd05
...
...
@@ -27,6 +27,7 @@
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/fruchterman_reingold.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/page_rank.hpp>
#include <boost/graph/random_layout.hpp>
#include <boost/graph/topology.hpp>
#include <boost/regex.hpp>
...
...
@@ -69,11 +70,13 @@ enum vertex_position_t { vertex_position };
enum
vertex_type_t
{
vertex_type
};
enum
vertex_record_t
{
vertex_record
};
enum
vertex_citation_t
{
vertex_citation
};
enum
vertex_pagerank_t
{
vertex_pagerank
};
namespace
boost
{
BOOST_INSTALL_PROPERTY
(
vertex
,
position
);
BOOST_INSTALL_PROPERTY
(
vertex
,
type
);
BOOST_INSTALL_PROPERTY
(
vertex
,
record
);
BOOST_INSTALL_PROPERTY
(
vertex
,
citation
);
BOOST_INSTALL_PROPERTY
(
vertex
,
pagerank
);
}
enum
NODE_TYPE
{
NODE_PAPER
,
...
...
@@ -94,8 +97,9 @@ typedef boost::property<vertex_index_t, int,
boost
::
property
<
vertex_position_t
,
point
,
//좌표값
boost
::
property
<
vertex_type_t
,
int
,
//타입. enum NODE_TYPE에 정의됨
boost
::
property
<
vertex_record_t
,
int
,
//이웃 노드 개수
boost
::
property
<
vertex_citation_t
,
int
>
//피인용수
>>>>
boost
::
property
<
vertex_citation_t
,
int
,
//피인용수
boost
::
property
<
vertex_pagerank_t
,
double
>
//페이지랭크 값
>>>>>
>
VertexProperties
;
typedef
boost
::
adjacency_list
<
listS
,
//outEdgeList
...
...
@@ -122,9 +126,8 @@ namespace {
const
int
NODE_SIZE
=
4
;
const
int
LAYOUT_MODE
=
GRAPH_LAYOUT
::
RANDOM_LAYOUT
;
//const int SCREEN_SIZE = 3000;
const
int
SCREEN_SIZE
=
500
;
const
int
READ_LINE_UNIT
=
100
;
//한 번에 몇 라인을 읽을지
//const int READ_LINE_UNIT = 100;
const
int
SCREEN_SIZE
=
3000
;
const
int
READ_LINE_UNIT
=
10
;
//한 번에 몇 라인을 읽을지
/* curl processor */
curl_processor
_curl_processor
;
...
...
Please
register
or
login
to post a comment