# A better way to chose a random neighbor

**URL:** https://discourse.julialang.org/t/a-better-way-to-chose-a-random-neighbor/80979
**Category:** New to Julia
**Tags:** optimization
**Created:** [May 12, 2022, 8:36pm UTC](https://discourse.julialang.org/t/a-better-way-to-chose-a-random-neighbor/80979 "2022-05-12T20:36:12Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 12, 2022, 11:05pm UTC](https://discourse.julialang.org/t/a-better-way-to-chose-a-random-neighbor/80979/4 "2022-05-12T23:05:25Z")

</div>

> [@lsaravia](#):
>
> Thanks! is there an example of how to implement ghost cells?

The “ghost cells” link [above](https://discourse.julialang.org/t/a-better-way-to-chose-a-random-neighbor/80979/2) has an example. [Here](https://discourse.julialang.org/t/seemingly-unnecessary-allocation-within-for-loop/72556/8) is another example, and [here](https://discourse.julialang.org/t/speed-up-multidimensional-code-without-base-cartesian/68328/14) is another.

---

_[View the full topic](https://discourse.julialang.org/t/a-better-way-to-chose-a-random-neighbor/80979)._
