# Using Laplacians to find fiedler values

**URL:** <https://discourse.julialang.org/t/using-laplacians-to-find-fiedler-values/32907>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [January 3, 2020, 5:22am UTC](https://discourse.julialang.org/t/using-laplacians-to-find-fiedler-values/32907 "2020-01-03T05:22:51Z")\
**Posts on this page:** 4\
**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:** [January 3, 2020, 5:22am UTC](https://discourse.julialang.org/t/using-laplacians-to-find-fiedler-values/32907/1 "2020-01-03T05:22:52Z")

</div>

@danspielman I am trying to find the fiedler value for a directed graph using `fiedler` command in Laplacians package in Julia.

```julia
using LightGraphs
using Laplacians

g=watts_strogatz(100,12,0.0,is_directed=true)
a=adjacency_matrix(g)
l=fiedler(a; nev=1, tol=0.0)

```

However, I get the following error:

```julia
ERROR: InexactError: Int64(0.8333333333333334)

```

---

<div class="post-metadata">

**Author:** ![danspielman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danspielman/32/4708_2.png) [@danspielman](https://discourse.julialang.org/u/danspielman)\
**Post date:** [January 5, 2020, 2:06am UTC](https://discourse.julialang.org/t/using-laplacians-to-find-fiedler-values/32907/2 "2020-01-05T02:06:08Z")

</div>

It seems that the `fiedler` function requires a matrix of Floats.  
You could construct one instead writing  
`a = Float64.(adjacency_matrix(g))`

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [January 5, 2020, 2:49am UTC](https://discourse.julialang.org/t/using-laplacians-to-find-fiedler-values/32907/3 "2020-01-05T02:49:38Z")

</div>

that’s worth submitting a PR for :).

If any other issues come up we should see how they are computing the laplacian.

---

<div class="post-metadata">

**Author:** ![natgeo-wong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/natgeo-wong/32/10965_2.png) [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Post date:** [January 5, 2020, 12:01pm UTC](https://discourse.julialang.org/t/using-laplacians-to-find-fiedler-values/32907/4 "2020-01-05T12:01:46Z")

</div>

Not necessarily the most related, but my brain is completely dead. Can the Laplacians package be used to solve the Laplace/Poisson equations (i.e. [Poisson's equation - Wikipedia](https://en.wikipedia.org/wiki/Poisson%27s_equation)) or is that an entirely different beast?
