[Top][All Lists]

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

[igraph] ?????? bipartite from edgelist?

From: ????????????
Subject: [igraph] ?????? bipartite from edgelist?
Date: Fri, 2 Aug 2013 11:26:54 +0800

for an edgelist file, we can use read.graph(in R) to load the graph, it seems fast, and the node id in edgelist file will be used as real node id.

however, if i add the vertices by reading the edgelist file myself, the node ids in the file will be only used as the names of the vertices.

if i add the two types of vertices in advance, how can i add the edges between them according to the edgelist file? it seems that add.edges can only add edges by names of the node?


------------------ ???????? ------------------
??????: "G??bor Cs??r"<address@hidden>;
????????: 2013??8??2??(??????) ????7:39
??????: "Help for igraph users"<address@hidden>;
????: Re: [igraph] bipartite from edgelist?

On Thu, Aug 1, 2013 at 6:16 PM, ???????????? <address@hidden> wrote:
i'm going to do as follow: as reading edgelist line by line, i add the vertices and edges by myself. during that process, i can add an attribute named "type", which is "b" for buyers, and "s" for sellers.

i have tested by small graph, it works.

That is a little surprising, because the 'type' attribute should be logical, i.e. TRUE or FALSE.
but it will be more slow i think, because i have to judge where a vertex or edge has existed, and the buyer id and seller id can't be considered as the vertex id, but as the name of the vertex.

To be honest, I don't really get it why it will be slow. Just create a network and assign a type attribute for all vertices at the same time, in the beginning.



reply via email to

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