Skip to content
Merged
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
11 changes: 9 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ Pkg.add(url="https://github.com/JuliaGraphs/MultilayerGraphs.jl")
Here we illustrate how to define, handle and analyse a `MultilayerGraph` (the directed version is completely analogous).

```julia
# Install necessary tutorial dependencies
using Pkg
Pkg.add(["Revise", "Distributions", "SimpleValueGraph",
"LoggingExtras", "StatsBase", "SimpleWeightedGraphs",
"MetaGraphs", "Agents", "MultilayerGraphs"])

# Import necessary tutorial dependencies
using Revise
using StatsBase, Distributions
using Graphs, SimpleWeightedGraphs, MetaGraphs, SimpleValueGraphs
Expand Down Expand Up @@ -116,7 +123,7 @@ MultilayerVertex(
)
```

Let's contruct a list of `MultilayerVertex`s to use in the remainder of the tutorial:
Let's construct a list of `MultilayerVertex`s to use in the remainder of the tutorial:

```julia
## Convert nodes to multilayer vertices without metadata
Expand Down Expand Up @@ -574,7 +581,7 @@ add_edge!(layer_swg, src_w, dst_w, _weight)
```
where `_weight` is exactly what you would pass to the `add_edge!` method that acts on `SimpleWeightedGraph` after:
```julia
simpleweightedgraph = SimpleWeightedGraph(5, 0)
simpleweightedgraph = SimpleWeightedGraph(SimpleGraph(5, 0))
add_edge!(simpleweightedgraph, 1, 2, _weight)
```

Expand Down
5 changes: 5 additions & 0 deletions example/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
MultilayerGraphs = "af984530-d72f-4904-8b81-b992bbbeaf3f"
SimpleValueGraphs = "b43c691f-cac2-5415-8122-396fe16a49fc"
7 changes: 7 additions & 0 deletions example/example.md → example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ Pkg.add(url="https://github.com/JuliaGraphs/MultilayerGraphs.jl")
Let's begin by importing the necessary dependencies and setting the relevant constants.

```julia
# Import the package manager
using Pkg
# Activate the environment
Pkg.activate(@__DIR__)
# Instantiate the environment
Pkg.instantiate()

# Import necessary dependencies
using Distributions, Graphs, SimpleValueGraphs
using MultilayerGraphs
Expand Down
11 changes: 11 additions & 0 deletions example/example.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#################################################
################# ENVIRONMENT ###################
#################################################

# Import the package manager
using Pkg
# Activate the environment
Pkg.activate(@__DIR__)
# Instantiate the environment
Pkg.instantiate()

#################################################
################### PACKAGES ####################
#################################################
Expand Down