Skip to content

Commit

Permalink
Updated graph examples to use a digraph
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-asmar committed Oct 18, 2024
1 parent f8074f9 commit 0b1f6d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ using Graphs # for DiGraph and add_edge!
using TikzGraphs # for TikZ plot output

# An example [Chvatal Graph](https://en.wikipedia.org/wiki/Chv%C3%A1tal_graph)
g = smallgraph(:chvatal)
g = wheel_digraph(12)

# Create notional names for the nodes
node_names = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"]
Expand All @@ -67,22 +67,22 @@ p = plot(g, node_names)

# Save as PDF (using TikzPictures)
using TikzPictures # to save TikZ as PDF
save(PDF("chvatal_tikz.pdf"), p)
save(PDF("wheel_tikz.pdf"), p)
```

##### GraphPlot.jl
```julia
using Graphs
using GraphPlot

g = smallgraph(:chvatal)
g = wheel_digraph(12)
node_names = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"]

p = gplot(g; nodelabel=node_names)

# Save using Compose
using Compose, Cairo, Fontconfig
draw(PDF("chvatal_graphplot.pdf", 16cm, 16cm), p)
draw(PDF("wheel_graphplot.pdf", 16cm, 16cm), p)
```

#### GraphRecipes.jl
Expand All @@ -92,12 +92,12 @@ using Plots
using GraphRecipes


g = smallgraph(:chvatal)
g = wheel_digraph(12)
node_names = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"]

p = graphplot(g; names=node_names, node_size=0.2)

savefig(p, "chvatal_graphrecipes.pdf")
savefig(p, "wheel_graphrecipes.pdf")
```

## Project 2: Reinforcement Learning
Expand Down

0 comments on commit 0b1f6d3

Please sign in to comment.