igraph-help
[Top][All Lists]
 Great thanks for your further comments! I should remember the 0-based indexing in using the existing igraph package. 于 2011-9-15 19:35, Gábor Csárdi 写道: ```On Thu, Sep 15, 2011 at 4:27 AM, Minh Nguyen wrote: ``` ```Hi, On Thu, Sep 15, 2011 at 6:23 PM, Zhijiang Wang wrote: ``` ```Thanks! why is the 0-starting index is used? ``` ```In computer science, our indices start from zero. In mathematics, indices start from one. Graph theory as treated by igraph is considered computer science. And people who develop igraph are computer scientists. ``` ```Another reason for the 0-based indexing was that igraph internals are written in C, and C uses 0-based indices for arrays, so it was natural (for a computer scientist at least) to go with that. Keeping the zero-based indexing in R simplified a lot of things, and made igraph somewhat faster. Soon I realized that 0-based in indices are causing problems in R. This will be only corrected in the coming 0.6 version, where vertices are indexed from 1 (if you use igraph from R). This also means that existing code will no longer be compatible with the new 0.6 version, unfortunately. Best, Gabor ``` ```于 2011-9-15 16:19, Minh Nguyen 写道: Hi, 2011/9/15 Zhijiang Wang : Dear all, I used the function maximal.cliques, and found the smallest index of vertices is 0. So, dose the index of vertices in a graph start from 0? Yes. ``` ```-- Regards Minh Van Nguyen _______________________________________________ igraph-help mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/igraph-help ``` ``` ``` -- `Best wishes,` `Zhijiang Wang` `--------------------------------------------` `PhD Candidate` `Room 407, East Segment, Material Science Building,` `The International WIC Institute,` `Brain Informatics,` `College of Computer Science and Technology,` `Beijing University of Technology,` `Beijing, China.`