igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] New user of igraph in C. Basic question about data importation


From: Paul Johnson
Subject: [igraph] New user of igraph in C. Basic question about data importation
Date: Sat, 25 Apr 2009 15:04:46 -0500

Hello, I'm new here.  I have been writing programs in C & Objective C
for about 15 years. We use agent-based models to simulate social
networks.  The model is written with the Swarm simulation libraries
(www.swarm.org) and so far we've published a few articles and one book
(Political Disagreement, Cambridge U. Press, 2004).

I have started a new stage in our research agenda.  I've Googled quite
a bit to find a well done C library for graph analysis and it appears
to me that igraph is the best.  I don't need GUI display or
point-and-click functionality, which seems to be the point of emphasis
in the other libraries.

We want to calculate the triad census and explore the community
detection functions that igraph provides.

Here is my question.  We have agents that are Objective-C objects, and
each one of them has information about the other agents it has
encountered.  So it would be possible for me to write out a vector of
the sort that is displayed in your examples.  This would be a very
long vector, however.
With 2000 agents or so, most of whom have between 10 and 20 contacts
with others,  I'm a little worried about the scale of the problem.
Should I really try to build a vector with 20,000 elements?  Or could
you show me how to add the vectors one-agent-at-a-time?

Before I get too far into this, can you please offer me some advice
about how I should prepare the data that the agents have for
importation into igraph?


I'm also curious why you declare real-valued (double) vectors that
hold only integer information, but I guess that's a different problem.
 From one of your examples, I find
      igraph_real_t  edges[] = { 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8,
                               0,10, 0,11, 0,12, 0,13, 0,17, 0,19, 0,21, 0,31,
                              28,31,28,33,29,32,29,33,30,32,30,33,31,32,31,33,
                              32,33
     };

why don't you use igraph_int_t for those declarations?

Well, I'm sorry to just barge into your group and ask such simplistic
questions.  But I have to start somewhere :)

-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]