Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
083a4d64
Commit
083a4d64
authored
Oct 12, 2009
by
Tiago Peixoto
Browse files
Fix path weights in absolute_trust()
This fixes how paths are weighted in the absolute_trust algorithm.
parent
e3c6b395
Changes
4
Show whitespace changes
Inline
Side-by-side
src/graph/centrality/graph_absolute_trust.cc
View file @
083a4d64
...
...
@@ -29,7 +29,7 @@ using namespace boost;
using
namespace
graph_tool
;
void
absolute_trust
(
GraphInterface
&
g
,
int64_t
source
,
boost
::
any
c
,
boost
::
any
t
,
size_t
n_paths
,
double
epsilon
,
bool
reversed
)
boost
::
any
t
,
size_t
n_paths
,
bool
reversed
)
{
if
(
!
belongs
<
edge_floating_properties
>
()(
c
))
throw
ValueException
(
"edge property must be of floating point value type"
);
...
...
@@ -38,7 +38,8 @@ void absolute_trust(GraphInterface& g, int64_t source, boost::any c,
run_action
<>
()(
g
,
bind
<
void
>
(
get_absolute_trust
(),
_1
,
g
.
GetVertexIndex
(),
source
,
_2
,
_3
,
n_paths
,
epsilon
,
reversed
),
g
.
GetEdgeIndex
(),
g
.
GetMaxEdgeIndex
(),
source
,
_2
,
_3
,
n_paths
,
reversed
),
edge_floating_properties
(),
vertex_floating_vector_properties
())(
c
,
t
);
}
...
...
src/graph/centrality/graph_absolute_trust.hh
View file @
083a4d64
...
...
@@ -48,60 +48,91 @@ struct path_cmp
typedef
bool
result_type
;
inline
bool
operator
()(
size_t
a
,
size_t
b
)
{
if
(
get
<
0
>
(
_paths
[
a
]).
first
==
get
<
0
>
(
_paths
[
b
]).
first
)
if
(
get
<
0
>
(
_paths
[
a
]).
second
==
get
<
0
>
(
_paths
[
b
]).
second
)
return
get
<
1
>
(
_paths
[
a
]).
size
()
>
get
<
1
>
(
_paths
[
b
]).
size
();
return
get
<
0
>
(
_paths
[
a
]).
first
<
get
<
0
>
(
_paths
[
b
]).
first
;
return
get
<
0
>
(
_paths
[
a
]).
second
<
get
<
0
>
(
_paths
[
b
]).
second
;
}
};
struct
get_absolute_trust
{
template
<
class
Graph
,
class
VertexIndex
,
class
TrustMap
,
template
<
class
Graph
,
class
VertexIndex
,
class
EdgeIndex
,
class
TrustMap
,
class
InferredTrustMap
>
void
operator
()(
Graph
&
g
,
VertexIndex
vertex_index
,
int64_t
source
,
TrustMap
c
,
InferredTrustMap
t
,
size_t
n_paths
,
double
epsilon
,
bool
reversed
)
const
void
operator
()(
Graph
&
g
,
VertexIndex
vertex_index
,
EdgeIndex
edge_index
,
size_t
max_edge_index
,
int64_t
source
,
TrustMap
c
,
InferredTrustMap
t
,
size_t
n_paths
,
bool
reversed
)
const
{
typedef
typename
graph_traits
<
Graph
>::
vertex_descriptor
vertex_t
;
typedef
typename
graph_traits
<
Graph
>::
edge_descriptor
edge_t
;
typedef
typename
property_traits
<
TrustMap
>::
value_type
c_type
;
typedef
typename
property_traits
<
InferredTrustMap
>::
value_type
::
value_type
t_type
;
typedef
typename
property_traits
<
InferredTrustMap
>::
value_type
::
value_type
t_type
;
// the path type: the first value is the (trust,weight) pair, the second
// the set of vertices in the path and the third is the list of edges,
// in the path sequence.
typedef
tuple
<
pair
<
t_type
,
t_type
>
,
tr1
::
unordered_set
<
vertex_t
>
,
siz
e_t
>
path_t
;
vector
<
edg
e_t
>
>
path_t
;
double
delta
=
epsilon
+
1
;
int
i
,
N
=
num_vertices
(
g
);
int
i
,
N
=
(
source
==
-
1
)
?
num_vertices
(
g
)
:
source
+
1
;
#pragma omp parallel for default(shared) private(i) schedule(dynamic)
for
(
i
=
(
source
==
-
1
)
?
0
:
source
;
i
<
((
source
==
-
1
)
?
N
:
source
+
1
);
++
i
)
for
(
i
=
(
source
==
-
1
)
?
0
:
source
;
i
<
N
;
++
i
)
{
vertex_t
v
=
vertex
(
i
,
g
);
if
(
v
==
graph_traits
<
Graph
>::
null_vertex
())
continue
;
t
[
v
].
resize
(
num_vertices
(
g
));
// path priority queue
vector
<
path_t
>
paths
(
1
);
vector
<
size_t
>
free_indexes
;
typedef
double_priority_queue
<
size_t
,
path_cmp
<
path_t
>
>
queue_t
;
queue_t
queue
=
queue_t
(
path_cmp
<
path_t
>
(
paths
));
get
<
0
>
(
paths
.
back
()).
first
=
get
<
0
>
(
paths
.
back
()).
second
=
1
;
get
<
1
>
(
paths
.
back
()).
insert
(
v
);
get
<
2
>
(
paths
.
back
())
=
vertex_index
[
v
];
queue
.
push
(
0
);
t
[
v
].
resize
(
num_vertices
(
g
));
unchecked_vector_property_map
<
t_type
,
VertexIndex
>
sum_weight
(
vertex_index
,
num_vertices
(
g
));
// this is the actual queue of paths which will be used to compute
// the trust values
queue_t
final_queue
=
queue_t
(
path_cmp
<
path_t
>
(
paths
));
// store all paths which reach a given vertex
unchecked_vector_property_map
<
tr1
::
unordered_set
<
size_t
>
,
VertexIndex
>
path_map
(
vertex_index
,
num_vertices
(
g
));
size_t
count
=
1
;
while
(
!
queue
.
empty
())
{
size_t
pi
=
queue
.
top
();
queue
.
pop_top
();
vertex_t
w
=
vertex
(
get
<
2
>
(
paths
[
pi
]),
g
);
vertex_t
w
;
// push queue top into final queue
if
(
get
<
2
>
(
paths
[
pi
]).
size
()
>
0
)
{
w
=
target
(
get
<
2
>
(
paths
[
pi
]).
back
(),
g
);
final_queue
.
push
(
pi
);
// augment path map
path_map
[
target
(
get
<
2
>
(
paths
[
pi
]).
back
(),
g
)].
insert
(
pi
);
}
else
{
w
=
v
;
// the first path
}
// if maximum size is reached, remove the bottom
if
((
n_paths
>
0
)
&&
(
final_queue
.
size
()
>
n_paths
))
{
size_t
bi
=
final_queue
.
bottom
();
final_queue
.
pop_bottom
();
// remove path from path map
path_map
[
boost
::
target
(
get
<
2
>
(
paths
[
bi
]).
back
(),
g
)].
erase
(
bi
);
if
(
bi
==
pi
)
continue
;
}
// augment paths and put them in the queue
typename
graph_traits
<
Graph
>::
out_edge_iterator
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
out_edges
(
w
,
g
);
e
!=
e_end
;
++
e
)
{
...
...
@@ -109,29 +140,22 @@ struct get_absolute_trust
// no loops
if
(
get
<
1
>
(
paths
[
pi
]).
find
(
a
)
==
get
<
1
>
(
paths
[
pi
]).
end
())
{
// new path; only follow non-zero paths
t_type
old
=
(
sum_weight
[
a
]
>
0
)
?
t
[
v
][
a
]
/
sum_weight
[
a
]
:
0
;
// only follow non-zero paths
if
(
c
[
*
e
]
>
0
||
(
reversed
&&
get
<
1
>
(
paths
[
pi
]).
size
()
==
1
))
{
size_t
npi
;
if
(
free_indexes
.
empty
())
{
paths
.
push_back
(
paths
[
pi
]);
// clone last path
npi
=
paths
.
size
()
-
1
;
}
else
{
npi
=
free_indexes
.
back
();
free_indexes
.
pop_back
();
paths
[
npi
]
=
paths
[
pi
];
}
path_t
&
np
=
paths
[
npi
];
path_t
&
np
=
paths
[
npi
];
// new path
if
(
!
reversed
)
{
// path weight
get
<
0
>
(
np
).
second
=
get
<
0
>
(
np
).
first
;
// path value
get
<
0
>
(
np
).
first
*=
c
[
*
e
];
}
else
...
...
@@ -141,46 +165,131 @@ struct get_absolute_trust
get
<
0
>
(
np
).
first
*=
c
[
*
e
];
}
get
<
1
>
(
np
).
insert
(
a
);
get
<
2
>
(
np
)
=
vertex_index
[
a
]
;
get
<
2
>
(
np
)
.
push_back
(
*
e
)
;
t
[
v
][
a
]
+=
get
<
0
>
(
np
).
first
*
get
<
0
>
(
np
).
second
;
sum_weight
[
a
]
+=
get
<
0
>
(
np
).
second
;
// keep following paths only if there is a chance
// they will make it into the final queue
if
((
n_paths
>
0
&&
final_queue
.
size
()
<
n_paths
)
||
(
final_queue
.
size
()
==
0
||
(
get
<
0
>
(
np
).
second
>=
get
<
0
>
(
paths
[
final_queue
.
bottom
()]).
second
)))
queue
.
push
(
npi
);
if
(
n_paths
>
0
&&
queue
.
size
()
>
n_paths
)
else
paths
.
pop_back
();
}
}
}
}
unchecked_vector_property_map
<
t_type
,
VertexIndex
>
weight_sum
(
vertex_index
,
num_vertices
(
g
));
// paths which were already calculated and can be skipped
tr1
::
unordered_set
<
size_t
>
skip
;
// calculate trust from paths in the final queue
while
(
!
final_queue
.
empty
())
{
size_t
bi
=
queue
.
bottom
();
queue
.
pop_bottom
();
free_indexes
.
push_back
(
bi
);
size_t
pi
=
final_queue
.
top
();
final_queue
.
pop_top
();
path_t
&
p
=
paths
[
pi
];
if
(
skip
.
find
(
pi
)
!=
skip
.
end
())
continue
;
// mark edges which are to be considered
unchecked_vector_property_map
<
uint8_t
,
EdgeIndex
>
mark
(
edge_index
,
max_edge_index
+
1
);
tr1
::
unordered_set
<
size_t
>&
apaths
=
path_map
[
target
(
get
<
2
>
(
p
).
back
(),
g
)];
// all paths with the
// same final target
tr1
::
unordered_set
<
size_t
>
vlist
;
// all vertices involved
for
(
typeof
(
apaths
.
begin
())
iter
=
apaths
.
begin
();
iter
!=
apaths
.
end
();
++
iter
)
{
for
(
size_t
j
=
0
;
j
<
get
<
2
>
(
paths
[
*
iter
]).
size
();
++
j
)
{
edge_t
e
=
get
<
2
>
(
paths
[
*
iter
])[
j
];
mark
[
e
]
=
1
;
vlist
.
insert
(
target
(
e
,
g
));
}
vlist
.
insert
(
boost
::
source
(
get
<
2
>
(
paths
[
*
iter
]).
front
(),
g
));
}
// compute out trust
unchecked_vector_property_map
<
t_type
,
VertexIndex
>
out_trust
(
vertex_index
,
num_vertices
(
g
));
for
(
typeof
(
vlist
.
begin
())
viter
=
vlist
.
begin
();
viter
!=
vlist
.
end
();
++
viter
)
{
vertex_t
u
=
*
viter
;
if
(
!
reversed
)
{
typename
graph_traits
<
Graph
>::
out_edge_iterator
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
out_edges
(
u
,
g
);
e
!=
e_end
;
++
e
)
if
(
mark
[
*
e
]
==
1
)
out_trust
[
u
]
+=
c
[
*
e
];
}
else
{
sum_weight
[
a
]
+=
get
<
0
>
(
paths
[
pi
]).
first
;
// if reversed, use "in-trust" instead
typename
in_edge_iteratorS
<
Graph
>::
type
e
,
e_end
;
for
(
tie
(
e
,
e_end
)
=
in_edge_iteratorS
<
Graph
>::
get_edges
(
v
,
g
);
e
!=
e_end
;
++
e
)
{
if
(
mark
[
*
e
]
==
1
)
out_trust
[
u
]
+=
c
[
*
e
];
}
if
(
sum_weight
[
a
]
>
0
)
delta
+=
abs
(
old
-
t
[
v
][
a
]
/
sum_weight
[
a
]);
}
}
free_indexes
.
push_back
(
pi
);
if
((
count
%
N
)
==
0
)
for
(
typeof
(
apaths
.
begin
())
iter
=
apaths
.
begin
();
iter
!=
apaths
.
end
();
++
iter
)
{
size_t
pi
=
*
iter
;
path_t
&
p
=
paths
[
pi
];
// calculate the trust value and weight of the path
t_type
w
=
1
,
val
=
1
;
for
(
size_t
i
=
0
;
i
<
get
<
2
>
(
p
).
size
();
++
i
)
{
edge_t
e
=
get
<
2
>
(
p
)[
i
];
vertex_t
u
=
(
!
reversed
)
?
boost
::
source
(
e
,
g
)
:
target
(
e
,
g
);
if
(
out_trust
[
u
]
>
0
)
{
if
(
delta
<
epsilon
)
break
;
if
((
!
reversed
&&
i
<
get
<
2
>
(
p
).
size
()
-
1
)
||
(
reversed
&&
i
>
0
))
w
*=
c
[
e
]
*
c
[
e
]
/
out_trust
[
u
];
else
delta
=
0
;
w
*=
c
[
e
]
/
out_trust
[
u
]
;
}
count
++
;
val
*=
c
[
e
]
;
}
vertex_t
u
=
target
(
get
<
2
>
(
p
).
back
(),
g
);
weight_sum
[
u
]
+=
w
;
t
[
v
][
u
]
+=
w
*
val
;
typename
graph_traits
<
Graph
>::
vertex_iterator
w
,
w_end
;
for
(
tie
(
w
,
w_end
)
=
vertices
(
g
);
w
!=
w_end
;
++
w
)
skip
.
insert
(
pi
);
}
}
int
j
,
N
=
num_vertices
(
g
);
#pragma omp parallel for default(shared) private(j) \
schedule(dynamic)
for
(
j
=
0
;
j
<
N
;
++
j
)
{
if
(
sum_weight
[
*
w
]
>
0
)
t
[
v
][
*
w
]
/=
sum_weight
[
*
w
];
vertex_t
w
=
vertex
(
i
,
g
);
if
(
w
==
graph_traits
<
Graph
>::
null_vertex
())
continue
;
if
(
weight_sum
[
w
]
>
0
)
t
[
v
][
w
]
/=
weight_sum
[
v
];
}
}
}
};
}
...
...
src/graph/centrality/minmax.hh
View file @
083a4d64
...
...
@@ -57,7 +57,6 @@ public:
void
pop_bottom
()
{
return
;
swap
(
_queue
.
front
(),
_queue
.
back
());
_queue
.
pop_back
();
if
(
!
_queue
.
empty
())
...
...
src/graph_tool/centrality/__init__.py
View file @
083a4d64
...
...
@@ -406,11 +406,11 @@ def eigentrust(g, trust_map, vprop=None, norm=False, epslon=1e-6, max_iter=0,
else
:
return
vprop
def
absolute_trust
(
g
,
trust_map
,
source
=
None
,
vprop
=
None
,
epsilon
=
1e-6
,
n_paths
=
100000
,
reversed
=
False
):
def
absolute_trust
(
g
,
trust_map
,
source
=
None
,
vprop
=
None
,
n_paths
=
10000
,
reversed
=
False
):
r
"""
Calculate the absolute trust centrality of each vertex in the graph,
or only
for a
given source
, if one is provided
.
Calculate the absolute trust centrality of each vertex in the graph,
from a
given source.
Parameters
----------
...
...
@@ -419,16 +419,14 @@ def absolute_trust(g, trust_map, source=None, vprop=None, epsilon=1e-6,
trust_map : :class:`~graph_tool.PropertyMap`
Edge property map with the values of trust associated with each
edge. The values must lie in the range [0,1].
source : Vertex
,
optional
(
default: None)
A vertex which is used the as the
sole
source for gathering trust
values, instead of all the vertices in the graph
.
source : Vertex
(
optional
,
default: None)
A vertex which is used the as the source for gathering trust
values. If
left unspecified, the trust values for all sources are computed
.
vprop : :class:`~graph_tool.PropertyMap`, optional (default: None)
Vertex property map where the values of eigentrust must be stored.
epsilon : float, optional (default: 1e-6)
Convergence criterion for the algorithm. If the summed difference of
trust values drops below this value, the algorithm stops.
n_paths : int, optimal (default: 100000)
Maximum number of paths to keep following at any given time.
Vector vertex property map where the values of trust for each source
must be stored.
n_paths : int, optimal (default: 10000)
Maximum number of paths to consider.
reversed : bool, optional (default: False)
Calculates the "reversed" trust instead: The direction of the edges are
inverted, but the path weighting is preserved in the original direction
...
...
@@ -466,15 +464,19 @@ def absolute_trust(g, trust_map, source=None, vprop=None, epsilon=1e-6,
.. math::
w_{\{i\to j\}} = \prod_{e\in \{i\to j\}}\{\delta_{t(e),j}(1-c_e) + c_e\},
w_{\{i\to j\}} = \prod_{e\in \{i\to j\}}\frac{c_e}{\Gamma^+_{\{i\to j\}}(s(e))}
\{c_e(1-\delta_{t(e),j}) + \delta_{t(e),j}},
such that the direct trust of the last edge on the path is not considered.
such that the direct trust of the last edge on the path is not
considered. The value :math:`\Gamma^+_{\{i\to j\}}(s(e))` is the sum of
trust values of the selected out-edges of vertex :math:`s(e)`, which also
belong to the set of edge-disjoint of paths from i to j.
The algorithm measures the absolute trust by following all vertex-disjoint
paths, and keeping them on a priority queue. Each iteration the path with
maximum weight is augmented, and the new paths pushed into the queue. The
algorithm stops when all paths are consumed, or when the
trust values are
not making any progress, according to the epsilon parameter
.
algorithm stops when all paths are consumed, or when the
all the ``n_paths``
paths with largest weights are found
.
If enabled during compilation, this algorithm runs in parallel.
...
...
@@ -487,31 +489,31 @@ def absolute_trust(g, trust_map, source=None, vprop=None, epsilon=1e-6,
>>> trust.get_array()[:] = random(g.num_edges())
>>> t = gt.absolute_trust(g, trust, source=g.vertex(0))
>>> print t.a
[ 0.00000000e+00 5.14258135e-02
5.71266121
e-0
3
5.72445966
e-0
4
0.00000000e+00
8.40870736
e-0
3
5.26183548
e-0
3
1.17886060
e-0
3
6.0150639
7e-0
4
1.29831325
e-0
3
1.
45797971
e-0
3
3.21480292
e-0
4
1.
71096778
e-0
3
2.74688614
e-0
3
4.62071739
e-0
3
8.09703326
e-0
4
0.00000000e+00
2.32699564
e-0
3
1
.26
41092
2e-0
3
2.39985303
e-0
3
5.8205216
0e-0
3
2.76647806
e-0
3
6.63350769
e-0
3
2.20195841
e-0
3
1.
29581958
e-0
4
5.18096899
e-0
3
1.92592209
e-0
3
1.
81210154
e-0
3
1.45646324
e-0
3
3.43043712
e-0
3
2.
452
891
82
e-0
2
4.32648258
e-0
3
9.89190855
e-0
4
1.
45417521
e-0
3
0.00000000e+00
9.99423350
e-0
4
7.88399750
e-0
5
0.00000000e+00
3
.0
3832976
e-0
3
8.55065176
e-0
3
0.00000000e+00 4.
5513703
7e-0
3
3.81341021
e-0
3
1.19730
767e-0
3
7.18323777
e-0
4
4.09318494
e-0
3
4
.0
079445
2e-0
4
1.
09034564
e-0
2
9.79985323
e-0
4
1.33199924
e-0
3
3.50390276
e-0
3
9
.9
4522820
e-0
4
1.58366908
e-0
3
1.67022801
e-0
3
2.66247928
e-0
3
9.99978606
e-0
4
5.60094151
e-0
3
1.75052181
e-0
3
4.69095413
e-0
3
4.66550013
e-0
4
1.61261048
e-0
3
4.6
4164
507
e-0
3
1.
29879335
e-0
2
1.21931927
e-0
3
1
.0
311406
2e-0
3
2.38873202e-01 4.40785917
e-0
3
2.05076506
e-0
3
1.67546702
e-0
3
1.24570365
e-0
1
0.00000000e+00
5.7214601
0e-0
4
2.
44438711
e-0
3
2.92452098
e-0
3
2.12275007
e-0
4
7.39329792
e-0
4
2.62264044e-01
3.34209850
e-0
4
1.3
7313498
e-0
3
1.54652980
e-0
3
3.93973002
e-0
4
5.35530090
e-0
4
7.
35038003
e-0
4
1.89651401
e-0
3
5.90688369
e-0
3
2.40109219
e-0
3
1.98770683
e-0
3
1.13007595e-04
6.62879127e-03 2.50902780
e-0
2
2.25743105
e-0
3
3.
42120043
e-0
3
4.94039204
e-0
4
5.57933981
e-0
3
2.84245886
e-0
3
2.
50370261
e-0
3
9.67803400
e-0
3
8.0377661
6e-02 1.3
1993888
e-0
3
2.41471
52
9
e-0
3
]
[ 0.00000000e+00 5.14258135e-02
2.42874582
e-0
4
1.05347472
e-0
6
0.00000000e+00
3.13429149
e-0
4
1.53697222
e-0
4
3.83063399
e-0
5
2.6566893
7e-0
6
2.04029901
e-0
5
1.
19582153
e-0
5
2.67743821
e-0
6
1.
50606560
e-0
4
1.51595650
e-0
5
5.72684475
e-0
5
2.16466381
e-0
6
0.00000000e+00
4.08340061
e-0
5
3
.26
89657
2e-0
6
7.80860267
e-0
5
7.3103329
0e-0
5
7.81690832
e-0
5
2.93440658
e-0
4
1.19013202
e-0
5
1.
60601849
e-0
6
6.79167712
e-0
5
9.35414301
e-0
5
1.
98991248
e-0
5
2.08142130
e-0
5
1.28565785
e-0
4
2.
83893
891e-0
3
8.45362053
e-0
5
1.15751883
e-0
5
1.
97248846
e-0
5
0.00000000e+00
7.51004486
e-0
6
5.49704676
e-0
7
0.00000000e+00
1
.0
6219388
e-0
4
9.64852468
e-0
4
0.00000000e+00 4.
7049602
7e-0
5
5.49108602
e-0
5
6.2361
767
0
e-0
6
1.32625806
e-0
6
7.35202433
e-0
5
2
.0
954690
2e-0
6
1.
99138155
e-0
3
4.32934771
e-0
6
2.61887887
e-0
5
2.55099939
e-0
5
3
.9
0874553
e-0
6
9.07765143
e-0
5
2.59243068
e-0
6
7.50032403
e-0
6
8.36211398
e-0
5
7.80814352
e-0
4
8.12133072
e-0
6
6.24066931
e-0
4
2.19465770
e-0
6
4.15039190
e-0
5
5.
41
4
64
668
e-0
5
1.
84421073
e-0
3
8.02449156
e-0
6
4
.0
147285
2e-0
6
3.76746767e-01 7.02886863
e-0
5
1.52365123
e-0
4
4.58687938
e-0
6
3.70470973
e-0
2
0.00000000e+00
1.8592296
0e-0
6
2.
05481272
e-0
5
1.41021895
e-0
4
1.45217040
e-0
6
3.18562543
e-0
6
2.62264044e-01
7.41140347
e-0
6
1.3
9150089
e-0
5
3.86583428
e-0
6
2.85681164
e-0
6
4.12923146
e-0
6
7.
05705402
e-0
7
2.12584322
e-0
5
1.65948868
e-0
4
3.10144404
e-0
5
5.08749580
e-0
6
0.00000000e+00
1.45435603e-03 4.19224443
e-0
3
4.88198531
e-0
5
3.
00152848
e-0
4
5.61591759
e-0
5
2.31951396
e-0
4
1.19051653
e-0
5
2.
34710286
e-0
5
6.27636571
e-0
4
1.6575960
6e-02 1.3
0944429
e-0
5
1.26282
52
6
e-0
5
]
"""
...
...
@@ -538,8 +540,7 @@ def absolute_trust(g, trust_map, source=None, vprop=None, epsilon=1e-6,
libgraph_tool_centrality
.
\
get_absolute_trust
(
g
.
_Graph__graph
,
source
,
_prop
(
"e"
,
g
,
trust_map
),
_prop
(
"v"
,
g
,
vprop
),
n_paths
,
epsilon
,
reversed
)
_prop
(
"v"
,
g
,
vprop
),
n_paths
,
reversed
)
finally
:
if
reversed
:
g
.
pop_filter
(
reversed
=
True
)
...
...
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