1
- Graphsconst _graph_funcs = Dict {Symbol,Any} (
1
+ const _graph_funcs = Dict {Symbol,Any} (
2
2
:spectral => spectral_graph,
3
3
:sfdp => sfdp_graph,
4
4
:circular => circular_graph,
@@ -162,14 +162,14 @@ function compute_laplacian(adjmat::AbstractMatrix, node_weights::AbstractVector)
162
162
L, D
163
163
end
164
164
165
- import LightGraphs
165
+ import Graphs
166
166
167
167
# TODO : so much wasteful conversion... do better
168
168
function estimate_distance (adjmat:: AbstractMatrix )
169
169
source, destiny, weights = get_source_destiny_weight (sparse (adjmat))
170
170
171
- g = LightGraphs . Graph (adjmat)
172
- dists = convert (Matrix{Float64}, hcat (map (i-> LightGraphs . dijkstra_shortest_paths (g, i). dists, LightGraphs . vertices (g))... ))
171
+ g = Graphs . Graph (adjmat)
172
+ dists = convert (Matrix{Float64}, hcat (map (i-> Graphs . dijkstra_shortest_paths (g, i). dists, Graphs . vertices (g))... ))
173
173
tot = 0.0 ; cnt = 0
174
174
for (i,d) in enumerate (dists)
175
175
if d < 1e10
@@ -186,27 +186,27 @@ function estimate_distance(adjmat::AbstractMatrix)
186
186
dists
187
187
end
188
188
189
- function get_source_destiny_weight (g:: LightGraphs .AbstractGraph )
189
+ function get_source_destiny_weight (g:: Graphs .AbstractGraph )
190
190
source = Vector {Int} ()
191
191
destiny = Vector {Int} ()
192
- sizehint! (source, LightGraphs . nv (g))
193
- sizehint! (destiny, LightGraphs . nv (g))
194
- for e in LightGraphs . edges (g)
195
- push! (source, LightGraphs . src (e))
196
- push! (destiny, LightGraphs . dst (e))
192
+ sizehint! (source, Graphs . nv (g))
193
+ sizehint! (destiny, Graphs . nv (g))
194
+ for e in Graphs . edges (g)
195
+ push! (source, Graphs . src (e))
196
+ push! (destiny, Graphs . dst (e))
197
197
end
198
198
get_source_destiny_weight (source, destiny)
199
199
end
200
200
201
- function get_adjacency_matrix (g:: LightGraphs .AbstractGraph )
201
+ function get_adjacency_matrix (g:: Graphs .AbstractGraph )
202
202
adjacency_matrix (g)
203
203
end
204
204
205
205
function get_adjacency_matrix (source:: AbstractVector{Int} , destiny:: AbstractVector{Int} )
206
206
get_adjacency_matrix (source, destiny, ones (length (source)))
207
207
end
208
208
209
- function get_adjacency_list (g:: LightGraphs .AbstractGraph )
209
+ function get_adjacency_list (g:: Graphs .AbstractGraph )
210
210
g. fadjlist
211
211
end
212
212
@@ -243,7 +243,7 @@ const graph_aliases = Dict(:curvature_scalar => [:curvaturescalar,:curvature],
243
243
graphplot(g; kwargs...)
244
244
245
245
Visualize the graph `g`, where `g` represents a graph via a matrix or a
246
- `LightGraphs .graph`.
246
+ `Graphs .graph`.
247
247
## Keyword arguments
248
248
```
249
249
dim = 2
@@ -325,12 +325,12 @@ more details.
325
325
edgecolor = :black ,
326
326
edgestyle = :solid ,
327
327
)
328
- # Process the args so that they are a LightGraphs .Graph.
329
- if length (g. args) <= 1 && ! (eltype (g. args[1 ]) <: AbstractArray ) && ! (g. args[1 ] isa LightGraphs . AbstractGraph) && method != :chorddiagram && method != :arcdiagram
328
+ # Process the args so that they are a Graphs .Graph.
329
+ if length (g. args) <= 1 && ! (eltype (g. args[1 ]) <: AbstractArray ) && ! (g. args[1 ] isa Graphs . AbstractGraph) && method != :chorddiagram && method != :arcdiagram
330
330
if ! LinearAlgebra. issymmetric (g. args[1 ]) || any (diag (g. args[1 ]) .!= zeros (length (diag (g. args[1 ]))))
331
- g. args = (LightGraphs . DiGraph (g. args[1 ]),)
331
+ g. args = (Graphs . DiGraph (g. args[1 ]),)
332
332
elseif LinearAlgebra. issymmetric (g. args[1 ])
333
- g. args = (LightGraphs . Graph (g. args[1 ]),)
333
+ g. args = (Graphs . Graph (g. args[1 ]),)
334
334
end
335
335
end
336
336
0 commit comments