Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify support for Undirected Graphs #140

Open
plofgren opened this issue Jan 29, 2015 · 2 comments
Open

Clarify support for Undirected Graphs #140

plofgren opened this issue Jan 29, 2015 · 2 comments

Comments

@plofgren
Copy link
Contributor

I have an application where I needed an undirected graph. I actually didn't realize until today that "Mutual" in StoredGraphDir meant undirected and was starting to write my own UndirectedGraph wrapper class when I noticed it. How should we make this more clear? For example I could add a comment to StoredGraphDir along the lines of
Mutual, // In a mutual graph, the outbound and inbound neighbors of each node are equal, and space is typically saved by only storing the outbound neighbors of each node
and/or add to the documentation of DirectedGraph that it actually also supports undirected graphs. Or should there be an UndirectedGraph wrapper in Cassovary?
@pankajgupta

@pankajgupta
Copy link
Contributor

Let's make this more explicit by adding a wrapper.

On Thu, Jan 29, 2015 at 2:05 PM, Peter Lofgren [email protected]
wrote:

I have an application where I needed an undirected graph. I actually
didn't realize until today that "Mutual" in StoredGraphDir meant undirected
and was starting to write my own UndirectedGraph wrapper class when I
noticed it. How should we make this more clear? For example I could add a
comment to StoredGraphDir along the lines of
Mutual, // In a mutual graph, the outbound and inbound neighbors of each
node are equal, and space is typically saved by only storing the outbound
neighbors of each node
and/or add to the documentation of DirectedGraph that it actually also
supports undirected graphs. Or should there be an UndirectedGraph wrapper
in Cassovary?
@pankajgupta https://github.com/pankajgupta


Reply to this email directly or view it on GitHub
#140.

@Alireza-Farahani
Copy link

Alireza-Farahani commented Feb 16, 2019

I'm using version 7.1.0 and can't find anything explicitly for undirected graphs. What's the correct way of working with undirected graphs?
A simple graph like 1 2 when loaded by this code:

    val graphReader = ListOfEdgesGraphReader.forIntIds(
      dir, prefix,
      graphDir = StoredGraphDir.Mutual 
    )
    val graph = graphReader.toArrayBasedDirectedGraph()
    println(graph)

prints

Node count: 2
Edge count: 2
Nodes:
NodeId => 1
InboundNodes[1] =>2|
OutboundNodes[1] =>2|

NodeId => 2
InboundNodes[0] =>
OutboundNodes[0] =>

which I think is confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants