Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
fixes docs, simplifies two functions (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbromberger authored Jul 19, 2017
1 parent adf6c6e commit 1d4c341
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
*.jl.cov
*.jl.mem
.vscode
docs/build/
docs/site/
benchmark/.results/*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
```

Expand Down
2 changes: 1 addition & 1 deletion src/centrality/betweenness.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/centrality/eigenvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/community/clustering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/flow/ext_multiroute_flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
18 changes: 6 additions & 12 deletions src/generators/randgraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/shortestpaths/astar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
1 change: 0 additions & 1 deletion test/generators/randgraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d4c341

Please sign in to comment.