DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
// Copyright 2004 The Trustees of Indiana University. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Authors: Douglas Gregor // Andrew Lumsdaine #ifndef BOOST_GRAPH_BETWEENNESS_CENTRALITY_CLUSTERING_HPP #define BOOST_GRAPH_BETWEENNESS_CENTRALITY_CLUSTERING_HPP #include
#include
#include
#include
#include
#include
namespace boost { /** Threshold termination function for the betweenness centrality * clustering algorithm. */ template
struct bc_clustering_threshold { typedef T centrality_type; /// Terminate clustering when maximum absolute edge centrality is /// below the given threshold. explicit bc_clustering_threshold(T threshold) : threshold(threshold), dividend(1.0) {} /** * Terminate clustering when the maximum edge centrality is below * the given threshold. * * @param threshold the threshold value * * @param g the graph on which the threshold will be calculated * * @param normalize when true, the threshold is compared against the * normalized edge centrality based on the input graph; otherwise, * the threshold is compared against the absolute edge centrality. */ template
bc_clustering_threshold(T threshold, const Graph& g, bool normalize = true) : threshold(threshold), dividend(1.0) { if (normalize) { typename graph_traits
::vertices_size_type n = num_vertices(g); dividend = T((n - 1) * (n - 2)) / T(2); } } /** Returns true when the given maximum edge centrality (potentially * normalized) falls below the threshold. */ template
bool operator()(T max_centrality, Edge, const Graph&) { return (max_centrality / dividend) < threshold; } protected: T threshold; T dividend; }; /** Graph clustering based on edge betweenness centrality. * * This algorithm implements graph clustering based on edge * betweenness centrality. It is an iterative algorithm, where in each * step it compute the edge betweenness centrality (via @ref * brandes_betweenness_centrality) and removes the edge with the * maximum betweenness centrality. The @p done function object * determines when the algorithm terminates (the edge found when the * algorithm terminates will not be removed). * * @param g The graph on which clustering will be performed. The type * of this parameter (@c MutableGraph) must be a model of the * VertexListGraph, IncidenceGraph, EdgeListGraph, and Mutable Graph * concepts. * * @param done The function object that indicates termination of the * algorithm. It must be a ternary function object thats accepts the * maximum centrality, the descriptor of the edge that will be * removed, and the graph @p g. * * @param edge_centrality (UTIL/OUT) The property map that will store * the betweenness centrality for each edge. When the algorithm * terminates, it will contain the edge centralities for the * graph. The type of this property map must model the * ReadWritePropertyMap concept. Defaults to an @c * iterator_property_map whose value type is * @c Done::centrality_type and using @c get(edge_index, g) for the * index map. * * @param vertex_index (IN) The property map that maps vertices to * indices in the range @c [0, num_vertices(g)). This type of this * property map must model the ReadablePropertyMap concept and its * value type must be an integral type. Defaults to * @c get(vertex_index, g). */ template
void betweenness_centrality_clustering(MutableGraph& g, Done done, EdgeCentralityMap edge_centrality, VertexIndexMap vertex_index) { typedef typename property_traits
::value_type centrality_type; typedef typename graph_traits
::edge_iterator edge_iterator; typedef typename graph_traits
::edge_descriptor edge_descriptor; typedef typename graph_traits
::vertices_size_type vertices_size_type; if (edges(g).first == edges(g).second) return; // Function object that compares the centrality of edges indirect_cmp
> cmp(edge_centrality); bool is_done; do { brandes_betweenness_centrality(g, edge_centrality_map(edge_centrality) .vertex_index_map(vertex_index)); edge_descriptor e = *max_element(edges(g).first, edges(g).second, cmp); is_done = done(get(edge_centrality, e), e, g); if (!is_done) remove_edge(e, g); } while (!is_done && edges(g).first != edges(g).second); } /** * \overload */ template
void betweenness_centrality_clustering(MutableGraph& g, Done done, EdgeCentralityMap edge_centrality) { betweenness_centrality_clustering(g, done, edge_centrality, get(vertex_index, g)); } /** * \overload */ template
void betweenness_centrality_clustering(MutableGraph& g, Done done) { typedef typename Done::centrality_type centrality_type; std::vector
edge_centrality(num_edges(g)); betweenness_centrality_clustering(g, done, make_iterator_property_map(edge_centrality.begin(), get(edge_index, g)), get(vertex_index, g)); } } // end namespace boost #endif // BOOST_GRAPH_BETWEENNESS_CENTRALITY_CLUSTERING_HPP
bc_clustering.hpp
Page URL
File URL
Prev
8/95
Next
Download
( 5 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.