Worked example

Vertices need a String property :name.

using SamplingPerceivedNetworks, Graphs, MetaGraphs, Random

g = MetaGraph(watts_strogatz(100, 6, 0.2; rng = MersenneTwister(1)))
for i in vertices(g)
    set_prop!(g, i, :name, "p$i")
end

One perceiver

The orbit of vertex 1, out to $d_{max} = 3$, and the number of candidate pairs in each bin:

orbit = vertexorbit(g, 1, 3)
bins  = samplingbins(orbit, 3)
Dict(k => length(v) for (k, v) in bins)
Dict{Tuple{Int64, Bool}, Int64} with 6 entries:
  (1, 1) => 5
  (2, 1) => 29
  (2, 0) => 127
  (3, 0) => 552
  (1, 0) => 10
  (3, 1) => 57

With moreinfo = true, samplebins also returns the degree bin and reality of each sampled pair:

lst, degrees, real = samplebins(
    MersenneTwister(2), bins;
    desired = ((3, 3), (3, 3), (3, 3)), dvals = (1, 2, 3), moreinfo = true,
)
first(collect(zip(lst, degrees, real)), 5)
5-element Vector{Tuple{Tuple{String, String}, Union{UnitRange{Int64}, Int64}, Bool}}:
 (("p3", "p100"), 1, 1)
 (("p98", "p99"), 1, 1)
 (("p3", "p4"), 1, 1)
 (("p82", "p79"), 2, 1)
 (("p3", "p2"), 2, 1)

The whole network

lists = samplenetwork(
    MersenneTwister(3), g;
    desired = ((5, 5), (5, 5), (5, 5)), dvals = (1, 2, 3), moreinfo = true,
)
length(lists)
100

psn_edgelists flattens the lists into a table for export (for example, with CSV.jl):

el = psn_edgelists(lists)
first(el, 5)
5×5 DataFrame
Rowperceiverfromtobinreal
StringStringStringStringBool
1p19p36p482false
2p19p36p842true
3p19p22p443false
4p19p62p653true
5p19p17p642true

edgelist returns the true network in the same format, for merging with survey responses:

first(edgelist(g), 3)
3×2 DataFrame
Rowfromto
StringString
1p1p3
2p1p4
3p1p82
Note

Looking up a vertex by name, as in vertexorbit(g, "p1", 3; index = false), requires set_indexing_prop!(g, :name). Integer vertex indices do not. The output converts node names to String.