# Storing Graphs

**URL:** <https://discourse.julialang.org/t/storing-graphs/28838>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 17, 2019, 5:33am UTC](https://discourse.julialang.org/t/storing-graphs/28838 "2019-09-17T05:33:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ennvvy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ennvvy/32/7816_2.png) [@ennvvy](https://discourse.julialang.org/u/ennvvy)\
**Post date:** [September 17, 2019, 5:33am UTC](https://discourse.julialang.org/t/storing-graphs/28838/1 "2019-09-17T05:33:36Z")

</div>

I use the following commands to generate small-world networks;

> using LightGraphs

> g = SimpleDiGraph{Int64} ;

> g = watts\_strogatz(100,24,0.5,is\_directed=true) ;

I would like to generate 100 different small-world networks with a fixed rewiring probability=0.5, and save it in a .jld file. What would be the best format to save them in?

---

<div class="post-metadata">

**Author:** ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)\
**Post date:** [September 17, 2019, 2:20pm UTC](https://discourse.julialang.org/t/storing-graphs/28838/2 "2019-09-17T14:20:44Z")

</div>

Quick and dirty: use the `Serialization` module i.e.

```julia
using Serialization
serialize("graphfile.bin", g) # g = deserialize("graphfile.bin")

```

For using the actual `jld` format, [JLD.jl](https://github.com/JuliaIO/JLD.jl)
