igraph-help
[Top][All Lists]
Advanced

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

[igraph] igraph-help-request


From: hubowhu
Subject: [igraph] igraph-help-request
Date: Thu, 2 Dec 2010 13:27:24 +0800

Dear all,
 
I am a c++ user of the igraph library which i found very useful, thank you very much to the authors.
 
I would like to define some function to analysis with urban street network , but I get some problems.
 
1) the igraph source is wrote in c/c++ in linux, I am not familiar with linux system, if I want to use the source code in
windows not the library , what suggetions from you?
 
2) the igraph could be able to deal with the double-directed graph? such as there is a street could be walked on the two sides, but in my GIS data there is only one polyline.
 
 
Thanks for you help .
Best wishes.
 
 
 
 
  2010-12-02

hubowhu

发件人: igraph-help-request
发送时间: 2010-12-02  02:45:39
收件人: igraph-help
抄送:
主题: igraph-help Digest, Vol 53, Issue 1
Send igraph-help mailing list submissions to
address@hidden
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.nongnu.org/mailman/listinfo/igraph-help
or, via email, send a message with subject or body 'help' to
address@hidden
You can reach the person managing the list at
address@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of igraph-help digest..."
Today's Topics:
   1. Re: create a (weighted) graph in C from txt files (G?bor Cs?rdi)
   2. igraph-help-request (hubowhu)
   3. Re: igraph-help-request (G?bor Cs?rdi)
----------------------------------------------------------------------
Message: 1
Date: Mon, 29 Nov 2010 21:48:49 +0100
From: G?bor Cs?rdi <address@hidden>
Subject: Re: [igraph] create a (weighted) graph in C from txt files
To: Help for igraph users <address@hidden>
Message-ID:
<address@hidden>
Content-Type: text/plain; charset=ISO-8859-1
Hi Francois,
On Mon, Nov 29, 2010 at 5:56 PM, Francois Bastardie <address@hidden> wrote:
> Dear all ,
>
>
>
> I am a R user of the igraph library which I found very useful, thank you
> very much to the authors.
>
>
>
> I would like now to switch to C/C++ because I would like to speed up my
> entire code which actually includes the igraph library only as a subroutine.
> However I am not very proficient in C/C++ and then I would like to ask you
> if you can help me for the beginning. I managed to compile igraph in a .dll
> using the microsoft visual C++ software and then I launched some examples
> embedded  with the library.
>
>
>
> Here it is: I would like to translate these following lines from R to some
> equivalent lines in C++. It is about a spatial network of nodes:
>
>
>
>   # BUILD THE IGRAPH OBJECT IN R
>
>  library(igraph)
>
> coord <- matrix(c(10, 9, 2, 4, 7,8, 45,34), ncol=2) # fake
>
> graph <- matrix(c(1,2,34,2,3,35,3,1,37, 4,1,30),ncol=3, byrow=TRUE) #fake
>
>  vertices    <- data.frame(name=as.character(unique(graph[,1])),
> x=coord[,1], y=coord[,2])  # name of the node, longitude, latitude
>
>  edges        <- data.frame(from=c(graph[,1]),
>
>                         to=c(graph[,2]),
>
>                         dist.km=graph[,3]) # name of the departure node,
> name of the arrival node, distance in km
>
>  g <- graph.data.frame(edges, directed=FALSE, vertices=vertices)
>
>
>
> I do not want to enter this by hand actually because I have more than 15000
> nodes in my actual data...
>
>
>
> My first guess is that I have to use the following C method to get back a
> graph with weighted edges (i.e. the distances between nodes)?
Well, you don't have to, there are several other file formats for
storing graphs. But this is one possibility.
> int igraph_read_graph_ncol(igraph_t *graph, FILE *instream,
>
>                           igraph_strvector_t *predefnames,
>
>                           igraph_bool_t names, igraph_bool_t weights,
> igraph_bool_t directed);
>
>
>
> In addition, I´m always struggling with the import/export of the files and
> that was one of the (many) reasons why I mainly used R for my work because
> with R we do not have to bother very much for importing and creating
> objects.
>
> Could you please give me some clues/examples to do that i.e. how to import
> the coordinates of the nodes and the distances between nodes in C/C++, and
> then create the graph I want?
You can read them the normal C/C++ way from your files, and then
create the igraph graph via igraph_create and add the coordinates as
attributes if you like, see
http://igraph.sourceforge.net/doc/html/ch09s02.html
http://igraph.sourceforge.net/doc/html/index.html
Alternatively, if you don't have many graphs to work with, you can
read them into R, and save them in some file format like GraphML or
GML, and then read them in from C.
Best,
Gabor
> Thank you very much,
>
> Best regards,
>
> Francois
>
>
>
>
>
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
-- 
Gabor Csardi <address@hidden>     UNIL DGM
------------------------------
Message: 2
Date: Wed, 1 Dec 2010 20:55:29 +0800
From: "hubowhu" <address@hidden>
Subject: [igraph] igraph-help-request
To: "igraph-help" <address@hidden>
Message-ID: <address@hidden>
Content-Type: text/plain; charset="gb2312"
hi :
when I use the development version of igraph in c, I  have a problem: I found no function used to analysis the information centrality of vertice, that's to say there's no function about information centrality?
thanks for your attentaion and suggestion 
bo hu
2010-12-01 
School of Geodesy and Geomatics 
Engineering Research Center for Spatio-Temporal 
Data Smart Acquisition and Application, Ministry of Education of China
PhD Candidate
Email:address@hidden
Tel:13296618048
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nongnu.org/archive/html/igraph-help/attachments/20101201/cea200a7/attachment.html
------------------------------
Message: 3
Date: Wed, 1 Dec 2010 17:07:16 +0100
From: G?bor Cs?rdi <address@hidden>
Subject: Re: [igraph] igraph-help-request
To: Help for igraph users <address@hidden>
Message-ID:
<address@hidden>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
you are right, information centrality is not implemented in igraph.
Gabor
2010/12/1 hubowhu <address@hidden>:
> hi :
>
> when I use the development version of igraph in c, I  have a problem: I
> found no function used to analysis the information centrality of vertice,
> that's to say there's no function about information centrality?
>
> thanks for your attentaion and suggestion
>
> bo hu
> 2010-12-01
> ________________________________
> School of Geodesy and Geomatics
> Engineering Research Center for Spatio-Temporal
> Data Smart Acquisition and Application, Ministry of Education of China
> PhD Candidate
> Email:address@hidden
> Tel:13296618048
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
-- 
Gabor Csardi <address@hidden>     UNIL DGM
------------------------------
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help
End of igraph-help Digest, Vol 53, Issue 1
******************************************

reply via email to

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