I have a weighted graph G
with ~2.5K vertices and ~250K edges.
(The edge weights are all in (0, 1), and the weight of each vertex is derived as the maximum of the weights of all the edges incident on it.)
Not surprisingly (given its size), I have not yet found an adequate way to visualize G
.
Therefore I'm now trying to visualize a suitable subgraph S
of G
, and to this end I'm trying to determine a good cutoff value that would determine which vertices and edges of the original graph to keep in the subgraph1.
Unfortunately I must be doing something very inefficient, because the following snippet takes longer to run than I've had the patience for:
truncate[g_, cutoff_]:= Module[{g0},
g0 = VertexDelete[g, Select[VertexList[g], PropertyValue[{g, #}, VertexWeight] < cutoff &]];
EdgeDelete[g0, Select[EdgeList[g0], PropertyValue[{g, #}, EdgeWeight] < cutoff &]]
];
S = truncate[G, 0.7]
(* $Aborted *)
More generally, I'm finding that almost any operation I perform on this graph takes a very long time.
Are there techniques/tools to facilitate working with graphs of this size?
(In particular, since a suitable cutoff would most likely result in the removal of far more vertices and/or edges than would be kept, it would make more sense to produce the desired subgraph "additively", i.e. from the relatively few vertices and edges that make the cut, rather than to do so "subtractively", by removing the many vertices and edges that don't, but I have not been able to figure out a convenient way to do the former in a way that preserves all of the original per-vertex and per-edge properties.)
1Initially I tried to use such cutoff to determine which vertices and edges to display, but this proved to be a fruitless strategy, because the hidden vertices and edges still influence the graph's default layout. This layout suggests that many of the edge weights are just noise.