JuliaAttic / OldGraphs.jl

Working with graphs in Julia
Other
205 stars 81 forks source link

Truncate show output for large graphs #28

Open dmbates opened 11 years ago

dmbates commented 11 years ago

I keep forgetting to put a semicolon after creating a GenericAdjacencyList object and some of them I am working with have hundreds of thousands of edges. Could you rework the show method to provide only a few elements from the beginning and the end of the adjacency list in such cases?

lindahua commented 11 years ago

Good point. I will look at how Julia deals with similar issues for arrays and revise the show method.

lindahua commented 11 years ago

I made an update to the show function. Currently, the show function only shows a very brief summary, and the show_details function shows more.

This should address the issue of showing too much for large graphs. Will work out a more pretty & intelligent way to show graphs when I get time to do so.

rsofaer commented 11 years ago

I think the current situation: Directed Graph (10 vertices, 19 edges) is good. I imagine any attempt to be clever about how much of the graph to print won't be satisfying to everyone, and anyone who has specific needs can replace show with whatever they want. The one thing I might add is the graph type, but those are a little long and confusing.

Directed Graph (10 vertices, 19 edges)
GenericIncidenceList{Int64,Edge{Int64},Range1{Int64},Array{Array{Edge{Int64},1},1}}