Open mure opened 2 years ago
If possible I use full string (simple diagrams with one word node names).
If I need to have complex diagram (each node has many relations) or node name is multiple words I use the first letters as node ids.
C[cow]
D[dog]
PB[polar bear]
P[parrot]
D --> PB
P --> C
This allows me to read lines with relations easily without need to map the name to A, B, C, ... and it keeps code clean.
This is a question that likely has subjective answers, but I'm curious to get opinions from the community. I find that when I create and edit graphs I start to struggle with managing node id names. As an example, say I have this graph:
Node ids are A,B,C,D. And now say I want to add a node in the middle of animal and parrot. The simplest thing is to continue the alphabet and name it 'E':
Now the ordering is jumbled up, E before D. Obviously this is an extremely trivial example, but when graphs grow in complexity and I'm making lots of changes it starts adding friction and makes the syntax harder to visually parse when it's out of order.
In practice, I don't care what node ids are. I would rather them be implicit most of the time, which is possible...as long as you don't need spaces or other special characters.
One approach is to use descriptive node ids:
So the question is, are there any conventions or guidelines for how to name node ids?