Учитывая, что у ваших путей нет повторяющихся узлов, самый естественный способ определить пути - это набор упорядоченных наборов узлов.
reset;
model;
set NODES;
set LINKS within {NODES,NODES};
param n_paths;
set PATHS{1..n_paths} within NODES ordered;
# Optional: identify all of the links implied by these paths, so we can
# check that they are in fact within LINKS.
param longest_path_length := max{i in 1..n_paths} card(PATHS[i]);
set LINKS_IMPLIED_BY_PATHS within LINKS := setof{
i in 1..n_paths,
j in 1..(longest_path_length-1): j < card(PATHS[i])
} (member(j,PATHS[i]),member(j+1,PATHS[i]))
;
data;
set NODES := A B C;
set LINKS := (A,B) (B,C);
param n_paths := 3;
set PATHS[1] := A B;
set PATHS[2] := A B C;
set PATHS[3] := B C;
display LINKS_IMPLIED_BY_PATHS;
# if we include a path like C A, we will get an error here because ("C","A")
# is not within LINKS.
# It should be possible to do this more tidily with a check statement but
# for the moment the syntax escapes me.
# Note that this error will ONLY appear at the point where we try to
# do something with LINKS_IMPLIED_BY_PATHS; it's not calculated or checked
# until then.
Это не совсем то, что вы просили, так как он определяет пути как последовательность узлов, а не ссылок, но это самый близкий, который я мог получить.