diff --git a/.gitignore b/.gitignore index 5d4a75761..340a88323 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store *.jl.cov *.jl.mem +.vscode docs/build/ docs/site/ benchmark/.results/* diff --git a/README.md b/README.md index a7e2922c9..687f30223 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ add an edge that already exists in a graph will result in a silent failure. ## Installation Installation is straightforward: -```julia +```julia-repl julia> Pkg.add("LightGraphs") ``` diff --git a/src/centrality/betweenness.jl b/src/centrality/betweenness.jl index a1e75932a..384663514 100644 --- a/src/centrality/betweenness.jl +++ b/src/centrality/betweenness.jl @@ -18,7 +18,7 @@ and for a directed graph, ``{(|V|-1)(|V|-2)}``. - `endpoints=false`: If true, include endpoints in the shortest path count. Betweenness centrality is defined as: `` -bc(v) = \\frac{1}{\\mathcal{N}} \sum_{s \\neq t \\neq v} +bc(v) = \\frac{1}{\\mathcal{N}} \\sum_{s \\neq t \\neq v} \\frac{\\sigma_{st}(v)}{\\sigma_{st}} ``. ### References diff --git a/src/centrality/eigenvector.jl b/src/centrality/eigenvector.jl index 1cd5c019b..4dc20a584 100644 --- a/src/centrality/eigenvector.jl +++ b/src/centrality/eigenvector.jl @@ -6,11 +6,11 @@ Compute the eigenvector centrality for the graph `g`. Eigenvector centrality computes the centrality for a node based on the centrality of its neighbors. The eigenvector centrality for node `i` is - ``\mathbf{Ax} = \lambda \mathbf{x}`` + ``\\mathbf{Ax} = λ \\mathbf{x}`` -where `A` is the adjacency matrix of the graph `g` with eigenvalue `\lambda`. +where `A` is the adjacency matrix of the graph `g` with eigenvalue `λ`. By virtue of the Perron–Frobenius theorem, there is a unique and positive -solution if `\lambda` is the largest eigenvalue associated with the +solution if `λ` is the largest eigenvalue associated with the eigenvector of the adjacency matrix `A`. ### References diff --git a/src/community/clustering.jl b/src/community/clustering.jl index c4d77fe4f..f950825c4 100644 --- a/src/community/clustering.jl +++ b/src/community/clustering.jl @@ -55,7 +55,7 @@ of `v` and `b` is the maximum number of possible triangles. If a list of vertice `vs` is specified, return two vectors representing the number of triangles and the maximum number of possible triangles, respectively, for each node in the list. -This function is related to the local clustering coefficient `r` by ``r=\frac{a}{b}``. +This function is related to the local clustering coefficient `r` by ``r=\\frac{a}{b}``. """ function local_clustering(g::AbstractGraph, v::Integer) storage = zeros(Bool, nv(g)) diff --git a/src/flow/ext_multiroute_flow.jl b/src/flow/ext_multiroute_flow.jl index f71a9deaa..6d36ccfa0 100644 --- a/src/flow/ext_multiroute_flow.jl +++ b/src/flow/ext_multiroute_flow.jl @@ -38,7 +38,7 @@ Output a set of (point, slope) that compose the restricted max-flow function of `flow_graph` from `source to `target` using capacities in `capacity_matrix`. ### Performance -One point by possible slope is enough (hence \mathcal{O}(λ×max_flow) complexity). +One point by possible slope is enough (hence ``\\mathcal{O}(λ×max_flow)`` complexity). """ function auxiliaryPoints end @traitfn function auxiliaryPoints( diff --git a/src/generators/randgraphs.jl b/src/generators/randgraphs.jl index bc876da96..953e7c6a9 100644 --- a/src/generators/randgraphs.jl +++ b/src/generators/randgraphs.jl @@ -346,9 +346,9 @@ end @doc_str """ static_fitness_model(m, fitness_out, fitness_in) -Generate a random graph with ``|fitness\_out + fitness\_in|`` vertices and `m` edges, +Generate a random graph with ``|fitness\\_out + fitness\\_in|`` vertices and `m` edges, in which the probability of the existence of ``Edge_{ij}`` is proportional with -respect to ``i ∝ fitness\_out`` and ``j ∝ fitness\_in``. +respect to ``i ∝ fitness\\_out`` and ``j ∝ fitness\\_in``. ### Optional Arguments - `seed=-1`: set the RNG seed. @@ -757,16 +757,11 @@ function nearbipartiteaffinity(sizes::Vector{T}, between::Real, intra::Real) whe end #Return a generator for edges from a stochastic block model near-bipartite graph. -function nearbipartiteaffinity(sizes::Vector{T}, between::Real, inter::Real, noise::Real) where T<:Integer - B = nearbipartiteaffinity(sizes, between, inter) + noise - # info("Affinities are:\n$B")#, file=stderr) - return B -end - -function nearbipartiteSBM(sizes, between, inter, noise; seed::Int = -1) - return StochasticBlockModel(sizes, nearbipartiteaffinity(sizes, between, inter, noise), seed=seed) -end +nearbipartiteaffinity(sizes::Vector{T}, between::Real, inter::Real, noise::Real) where T<:Integer = + nearbipartiteaffinity(sizes, between, inter) + noise +nearbipartiteSBM(sizes, between, inter, noise; seed::Int = -1) = + StochasticBlockModel(sizes, nearbipartiteaffinity(sizes, between, inter, noise), seed=seed) """ random_pair(rng, n) @@ -808,7 +803,6 @@ function Graph(nvg::Integer, neg::Integer, edgestream::Channel) g = Graph(nvg) # println(g) for e in edgestream - # print("$count, $i,$j\n") add_edge!(g, e) ne(g) >= neg && break end diff --git a/src/shortestpaths/astar.jl b/src/shortestpaths/astar.jl index 950ca9025..65554d5aa 100644 --- a/src/shortestpaths/astar.jl +++ b/src/shortestpaths/astar.jl @@ -39,7 +39,7 @@ end a_star(g, s, t[, distmx][, heuristic]) Return a vector of edges comprising the shortest path between vertices `s` and `t` -using the [A\* search algorithm](http://en.wikipedia.org/wiki/A%2A_search_algorithm). +using the [A* search algorithm](http://en.wikipedia.org/wiki/A%2A_search_algorithm). An optional heuristic function and edge distance matrix may be supplied. If missing, the distance matrix is set to [`DefaultDistance`](@ref) and the heuristic is set to `n -> 0`. diff --git a/test/generators/randgraphs.jl b/test/generators/randgraphs.jl index 61b9d8ceb..5ec7af9e3 100644 --- a/test/generators/randgraphs.jl +++ b/test/generators/randgraphs.jl @@ -201,7 +201,6 @@ function generate_nbp_sbm(numedges, sizes) density = 1 - # print(STDERR, "Generating communites with sizes: $sizes\n") between = density * 0.90 intra = density * -0.005 noise = density * 0.00501