igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Dose the index of vertices in a graph start from 0?


From: Zhijiang Wang
Subject: Re: [igraph] Dose the index of vertices in a graph start from 0?
Date: Thu, 15 Sep 2011 20:35:22 +0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.22) Gecko/20110902 Thunderbird/3.1.14 ThunderBrowse/3.8

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 <address@hidden> wrote:
Hi,

On Thu, Sep 15, 2011 at 6:23 PM, Zhijiang Wang
<address@hidden> 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 <address@hidden>:

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.

reply via email to

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