First, I highly recommend checking out the free courses on the graph academy site:
Free, Self-Paced, Hands-on Online Training | Free Neo4j Courses from GraphAcademy
For removing nodes and creating relationships, you can DETACH DELETE a node which will remove the node and its relationships and create relationships where necessary. If you are importing this data, you may want to look at how you are scripting that if you want your nodes and relationships to look differently. Having the right model may help you with your queries as well.
Second, when you say "between themselves" do you mean you want to return the nodes between the CellInstances and the Functions or do you just want to return the SubGraphInstance, CellInstances, and Functions? Depending on what you actually want, you may end up taking different approaches.
Let's say you wanted to return the green, yellow, and red cells. You may end up with a cypher query like:
(NOTE: I am not going back and forth between the screenshot to get the exact nodes / relationships / relationship depths):
MATCH (g:Green)-[:SOME_REL]->(o:Orange)-[*3]->(r:Red)
RETURN g, o, r
The * is stating a variable path length, which will depend on the relationships between your nodes. This will return disconnected nodes in the graph view but if you go to the table, you'll have a row for each combo of green, orange, and red.
If you know the source and destination, and want the nodes in between, you can use a path and return the whole path like:
(NOTE: I am not going back and forth between the screenshot to get the exact nodes / relationships / relationship depths)
MATCH p = (g:Green)-[:SOME_REL]->(o:Orange)-[*3]-(r:Red)
RETURN p
// OR to find the path from a specific Red to Green and stuff in between
MATCH p = (r:Red { property: "matches" })-[*6]-(g:Green)
RETURN p