Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ version = "1.13.3"
[deps]
ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
Comment on lines +8 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should not be dependencies of the project as a whole, only of the docs

Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"

[compat]
Documenter = "1"
6 changes: 5 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Documenter
using DocumenterCitations
using Graphs

# same for contributing and license
Expand Down Expand Up @@ -85,11 +86,14 @@ pages = [
] for (section_name, section_files) in pages_files
]

bib = CitationBibliography(joinpath(@__DIR__, "src/references.bib"); style=:authoryear)

makedocs(;
plugins=[bib],
modules=[Graphs],
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
assets=String[],
assets=String["assets/citations.css"],
collapselevel=1,
canonical="https://gdalle.github.io/Graphs.jl",
),
Expand Down
5 changes: 5 additions & 0 deletions docs/src/algorithms/centrality.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ Pages = [
]

```

## References

```@bibliography
```
Comment on lines +28 to +31
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a more central page, as it will contain all references ever added, not just the references about centrality. I would suggest making a new page dedicated just to references.

17 changes: 17 additions & 0 deletions docs/src/assets/citations.css
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this file? I would prefer to stick to the default unless there are specific reasons to avoid it.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.citation dl {
display: grid;
grid-template-columns: max-content auto; }
.citation dt {
grid-column-start: 1; }
.citation dd {
grid-column-start: 2;
margin-bottom: 0.75em; }
.citation ul {
padding: 0 0 2.25em 0;
margin: 0;
list-style: none !important;}
.citation ul li {
text-indent: -2.25em;
margin: 0.33em 0.5em 0.5em 2.25em;}
.citation ol li {
padding-left:0.75em;}
51 changes: 51 additions & 0 deletions docs/src/references.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
@article{brandes2001faster,
title={A faster algorithm for betweenness centrality},
author={Brandes, Ulrik},
journal={Journal of mathematical sociology},
volume={25},
number={2},
pages={163--177},
year={2001},
publisher={Taylor \& Francis}
}

@article{barabasi2004network,
title={Network biology: understanding the cell's functional organization},
author={Barabasi, Albert-Laszlo and Oltvai, Zoltan N},
journal={Nature reviews genetics},
volume={5},
number={2},
pages={101--113},
year={2004},
publisher={Nature Publishing Group UK London}
}

@article{shimbel1953structural,
title={Structural parameters of communication networks},
author={Shimbel, Alfonso},
journal={The bulletin of mathematical biophysics},
volume={15},
number={4},
pages={501--507},
year={1953},
publisher={Springer}
}

@article{bonacich1987power,
title={Power and centrality: A family of measures},
author={Bonacich, Phillip},
journal={American journal of sociology},
volume={92},
number={5},
pages={1170--1182},
year={1987},
publisher={University of Chicago Press}
}

@misc{datta2012book,
title={Book Review: “Networks: An Introduction”, by Mark EJ Newman, Oxford University Press, 2010; ISBN: 978-0-19-920665-0 (Hardback)},
author={Datta, Sujit S},
year={2012},
publisher={Springer}
}

7 changes: 2 additions & 5 deletions src/centrality/eigenvector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ eigenvector of the adjacency matrix \$\\mathbf{A}\$.

### References

- Phillip Bonacich: Power and Centrality: A Family of Measures.
American Journal of Sociology 92(5):1170–1182, 1986
http://www.leonidzhukov.net/hse/2014/socialnetworks/papers/Bonacich-Centrality.pdf
- Mark E. J. Newman: Networks: An Introduction.
Oxford University Press, USA, 2010, pp. 169.
- [bonacich1987power](@cite)
- [datta2012book](@cite)
"""
function eigenvector_centrality(g::AbstractGraph)
return abs.(vec(eigs(adjacency_matrix(g); which=LM(), nev=1)[2]))::Vector{Float64}
Expand Down
2 changes: 1 addition & 1 deletion src/centrality/radiality.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ where ``D_g`` is the diameter of the graph and ``d_{u,v}`` is the
length of the shortest path from ``u`` to ``v``.

### References
- Brandes, U.: A faster algorithm for betweenness centrality. J Math Sociol 25 (2001) 163-177
- [brandes2001faster](@cite)

# Examples
```jldoctest
Expand Down
4 changes: 2 additions & 2 deletions src/centrality/stress.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ vertices. Return a vector representing the centrality calculated for each node i
The stress centrality of a vertex ``n`` is defined as the number of shortest paths passing through ``n``.

### References
- Barabási, A.L., Oltvai, Z.N.: Network biology: understanding the cell's functional organization. Nat Rev Genet 5 (2004) 101-113
- Shimbel, A.: Structural parameters of communication networks. Bull Math Biophys 15 (1953) 501-507.
- [barabasi2004network](@cite)
- [shimbel1953structural](@cite)

# Examples
```jldoctest
Expand Down
Loading