GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Graph::SocialMap(3) User Contributed Perl Documentation Graph::SocialMap(3)

Graph::SocialMap - Easy tool to create social network map

    # The Structure of relationship
    my $relation = {
        'WorkWith'  => [qw/Marry Rose/],
        'ChatWith'  => [qw/Marry Peacock/],
        'DanceWith' => [qw/Rose Joan/],
        'HackWith'  => [qw/Gugod Autrijus/],
    };

    # Generate a Graph::SocialMap object.
    my $gsm = Graph::SocialMap->new(relation => $relation) ;

    # People Network (Graph::Undirected object)
    my $pn = $gsm->people_network;

    # Save it with Graph::Writer::* module
    my $writer = Graph::Writer::DGF->new();
    $writer->write_graph($pn,'type1.dgf');

    # Weight of person (equal to the number of occurence)
    # Should be 2
    print $gsm->wop->{Rose};

    # Degree of seperation
    # Should be 2 (Marry -> Rose -> Joan)
    print $gsm->dos('Marry','Joan');
    # Should be less then zero (Unreachable)
    print $gsm->dos('Gugod','Marry');

    # all-pair dos (hashref of hashref)
    $gsm->all_dos;

This module implement a interesting graph application that is called the 'Social Relation Map'. It provides object-oriented way to retrieve many social information that can be found in this map.

The "new()" constructor accepts one argument in the for of 'hashref of arrayref'. The key to this hash is the name of relation, and the value of the hash is a list of identities involved in this relation.

Take the synopsis for an example, the structure:

    my $relation = {
        'WorkWith' => [qw/Marry Rose/],
        'ChatWith' => [qw/Marry Peacock/],
        'DanceWith' => [qw/Rose Joan/],
        'HackWith' => [qw/Gugod Autrijus/],
    };

Defines 4 issues which have common people involves in, the relation 'WorkWith' involves Marry and Rose, and the relation 'ChatWith' involves Marry and Peacock. By this 2 relations, we say that Marry is directly connected to Rose and Peacock, and Rose and Peacock are connected to each other indirectly, with degree of seperation 1. Likewise, Marry and Joan are connected to each other with degree of seperation 2.

Once constructed, you may call the following object methods to retrieve further social network information.
affiliation_network()
Affiliation network -- directly construct a network from given issue-people relation. Returns a Graph::Undirected object that is a bi-partie graph, one part of it present issues, the others are present people. Issue nodes and People nodes are connected if they are related.
people_network()
People network -- two people are connected if they are involed in at least one common issue. Return a Graph::Undirected object.
issue_network()
Issue network -- two issues are connected if they involved at least one common person. Return a Graph::Undirected object.

Copyright 2004,2005 by Kang-min Liu <gugod@gugod.org>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See <http://www.perl.com/perl/misc/Artistic.html>

2005-02-01 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.