Jose, welcome to the community! Love the challenge. IMHO, it's easier to code problems like this in js, python or, in some cases, I've even used SQL - where you create the Cypher and then send that off to run or just copy/paste into the browser. I'm assuming you are wanting to create a "complete graph" but do NOT wish for self relationships - i.e., an adjacency matrix basically (1's in all pairs except for (0,0), (1,1), etc. I'm a graph nerd and Neo is a bit lenient for my blood in terms of direction of the relationship, so because it's iff'y doing (a)--(b), and I'm assuming you want the truly complete adjacency matrix, I would want to see a 1 value both for (a)<--(b) and (a)-->(b) explicitly.
I do wish Cypher had better loop and if/then/else constructs. Maybe someday , but for now, in Cypher, this is a more challenging problem than it would be in say, Python. I'll piggy back of tony's great response but I'll remove that self-ref and make it copy/paste ready to test.
So, this will work:
WITH [p1, p2, p3, p4] as borg
WITH borg as borg1, borg as borg2
UNWIND borg1 as drone1
UNWIND borg2 as drone2
WITH drone1, drone2 WHERE drone1 <> drone2
...and will give you the view below. So, it's a bit "brute force" because it's O(n^2) and should be O((n(n-1))/2), which you'd get in a good Python implementation. Not a big deal for four nodes...but might be a concern for 4B
HTH and thanks for giving me a fun break in my day