Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
43
Issues
43
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
1c796549
Commit
1c796549
authored
Sep 29, 2012
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in eigenvector(), pagerank() and eigentrust() with undirected graphs
parent
08a4a117
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
src/graph/centrality/graph_eigentrust.hh
src/graph/centrality/graph_eigentrust.hh
+2
-2
src/graph/centrality/graph_eigenvector.hh
src/graph/centrality/graph_eigenvector.hh
+7
-4
src/graph/centrality/graph_pagerank.hh
src/graph/centrality/graph_pagerank.hh
+7
-4
No files found.
src/graph/centrality/graph_eigentrust.hh
View file @
1c796549
...
...
@@ -42,7 +42,7 @@ struct get_eigentrust
// Norm c values
InferredTrustMap
c_sum
(
vertex_index
);
if
(
typename
is_directed
::
apply
<
Graph
>::
type
()
)
if
(
is_directed
::
apply
<
Graph
>::
type
::
value
)
{
TrustMap
c_temp
(
edge_index
,
c
.
get_storage
().
size
());
...
...
@@ -120,7 +120,7 @@ struct get_eigentrust
{
typename
graph_traits
<
Graph
>::
vertex_descriptor
s
=
source
(
*
e
,
g
);
if
(
!
typename
is_directed
::
apply
<
Graph
>::
type
()
)
if
(
!
is_directed
::
apply
<
Graph
>::
type
::
value
)
t_temp
[
v
]
+=
get
(
c
,
*
e
)
*
t
[
s
]
/
abs
(
c_sum
[
s
]);
else
t_temp
[
v
]
+=
get
(
c
,
*
e
)
*
t
[
s
];
...
...
src/graph/centrality/graph_eigenvector.hh
View file @
1c796549
...
...
@@ -72,12 +72,15 @@ struct get_eigenvector
continue
;
c_temp
[
v
]
=
0
;
typename
in_edge_iteratorS
<
Graph
>::
type
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
in_edge_iteratorS
<
Graph
>::
get_edges
(
v
,
g
);
typename
in_
or_out_
edge_iteratorS
<
Graph
>::
type
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
in_
or_out_
edge_iteratorS
<
Graph
>::
get_edges
(
v
,
g
);
e
!=
e_end
;
++
e
)
{
typename
graph_traits
<
Graph
>::
vertex_descriptor
s
=
source
(
*
e
,
g
);
typename
graph_traits
<
Graph
>::
vertex_descriptor
s
;
if
(
is_directed
::
apply
<
Graph
>::
type
::
value
)
s
=
source
(
*
e
,
g
);
else
s
=
target
(
*
e
,
g
);
c_temp
[
v
]
+=
get
(
w
,
*
e
)
*
c
[
s
];
}
norm
+=
power
(
c_temp
[
v
],
2
);
...
...
src/graph/centrality/graph_pagerank.hh
View file @
1c796549
...
...
@@ -73,12 +73,15 @@ struct get_pagerank
continue
;
rank_type
r
=
0
;
typename
in_edge_iteratorS
<
Graph
>::
type
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
in_edge_iteratorS
<
Graph
>::
get_edges
(
v
,
g
);
typename
in_
or_out_
edge_iteratorS
<
Graph
>::
type
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
in_
or_out_
edge_iteratorS
<
Graph
>::
get_edges
(
v
,
g
);
e
!=
e_end
;
++
e
)
{
typename
graph_traits
<
Graph
>::
vertex_descriptor
s
=
source
(
*
e
,
g
);
typename
graph_traits
<
Graph
>::
vertex_descriptor
s
;
if
(
is_directed
::
apply
<
Graph
>::
type
::
value
)
s
=
source
(
*
e
,
g
);
else
s
=
target
(
*
e
,
g
);
r
+=
(
get
(
rank
,
s
)
*
get
(
weight
,
*
e
))
/
get
(
deg
,
s
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment