Link two nodes with a edge

Hello, so to preface this question. I am creating a custome navigation system for my game and have hit a road block. I am at a point where I have my ‘nodes’ which I will use as part of my path finding, but now I need some way to link them and to give that link a weight.

My nodes are just created with empty game objects that my player can move towards, but I am not sure how to represent the edge weights between any given two nodes.

My nodes have a unique ID that I can reference later, and with that in mind here is a basic picture of what I am trying to accomplish.

UID = 0       Edge (Weight = 1)      UID = 1
[Node1] --------------------------- [Nodes2]

There are many ways to do this.

You can have a Node script on each node and store neighbours/weights there.

You can have a Node Map/List script and store all relations there (for example, in your path-finding script).

You can have Edge GameObjects with scripts and store nodes there (or Edge map/list script).

You can, in fact, do all this without game objects for performance, all of this depends on how the rest of your game is structured.