Do edge-features need to be the same for direct and reverse edges for a graph to be undirected? #8293
-
Hi! I am constructing graphs that judging from the edge_index only should be undirected, because for every edge pointing from node i to node j there is always an edge pointing from j to i. However, it is possible that the edge attributes of edge i->j are different from those of the edge j->i. Does this make the graph not qualify as undirected? In other words, is the criterium for setting a graph as directed/undirected dependent on edge attributes as well as edge indices? Indeed, when I use is_undirected it comes back as false... I tried to answer this question by checking directly in the source code, but could not interpret how it is done, I'm afraid. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
PyG does not really know about the concept of "undirected graphs", so you are free to either replicate edge features for both directions, or use separate edge features. Regarding |
Beta Was this translation helpful? Give feedback.
PyG does not really know about the concept of "undirected graphs", so you are free to either replicate edge features for both directions, or use separate edge features.
Regarding
to_undirected
: Yes, these methods ensure that edge features match in both directions.