first i would like to point you to our guidelines. You will read there how to mark your thread as a question and how to use tags.
You got some example in our github repository that could help. The first one will show you how to iterate nodes and go inside groups if any. The second is to create and connect nodes. Once you got your node, you must use the function AddPort
You have to define the direction (output or input) and use the right ID
child.AddPort(c4d.GV_PORT_OUTPUT, c4d.ID_BASEOBJECT_REL_POSITION )
child.AddPort(c4d.GV_PORT_OUTPUT, [c4d.ID_BASEOBJECT_REL_POSITION,c4d.VECTOR_X] )
Don't forget you can use drag and drop on the python console to retrieve the IDs, more information on this page