Hi, this is a continuation of finding link distances between species in a food web. It’s been a few months so I am starting a new topic. I can find distances between species, but when I want to randomly choose a species pair with a link distance of for example 3, LightGraphs gives me four options which are actually 2 options (because the matrix is diagonally mirrored).
The option of species 1 and species 3 is the same as species 3 and species 1. Is there a way to specify I only want pairings from half the matrix, or to state that (1,3) is the same as (3,1)?
Example code
using LightGraphs
foodWeb2 = [0 0 0 0 1;
0 0 0 1 0;
0 0 0 1 0;
0 0 0 0 1;
0 0 0 0 0]
test_graph = DiGraph(foodWeb2)
test_graph2 = SimpleGraph(test_graph) # LD is link_distance
test_graph2_results = floyd_warshall_shortest_paths(test_graph2)
harvesting_range = findall(x -> 3.0 <= x, test_graph2_results.dists) # gives 4 coordinates, which refer to two species pairings