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.
It would be nice to have some complete example (=code), to see what exactly you did. read.graph() can read various formats, and sometimes vertex names are created, sometimes not. I guess you used format="edgelist", so no vertex names were added.
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?
You can add edges based on numeric vertex ids as well. The type of the vertex has not much to do with the name of the vertex, so I still don't get the problem.
Gabor
[...]