# The graph division at the specified node

Let us consider a graph1:

g1 = {1 <-> 2, 2 <-> 3, 3 <-> 4, 4 <-> 5, 5 <-> 6, 6 <-> 7, 7 <-> 19,19 <-> 20, 19 <-> 22, 20 <-> 21, 20 <-> 23, 7 <-> 8, 8 <-> 24, 24 <-> 25, 24 <-> 26, 8 <-> 9, 9 <-> 10, 9 <-> 27, 27 <-> 28, 27 <-> 29, 10 <-> 11, 11 <-> 12, 12 <-> 13, 13 <-> 14, 14 <-> 15,15 <-> 16, 16 <-> 17, 17 <-> 18, 12 <-> 30, 30 <-> 31, 31 <-> 32, 32 <-> 33, 30 <-> 34, 31 <-> 35, 32 <-> 36, 34 <-> 37, 34 <-> 38, 2 <-> 39, 3 <-> 40, 4 <-> 41, 5 <-> 42, 6 <-> 43, 10 <-> 44, 11 <-> 45, 13 <-> 46, 14 <-> 47, 15 <-> 48, 16 <-> 49, 17 <-> 50,18 <-> 51, 18 <-> 52, 1 <-> 53, 1 <-> 54};

How to split graph1 in a specific node? Let the division node be a node 7. After division in node 7 we should get two graphs:

I made this division by hand. The problem arises when I have a very large graph. The FindGraphPartition [] function is not suitable.

• Have you noticed that you can "split" the graph on vertex 7 multiple differing ways? Commented Mar 28, 2018 at 6:54
• Yes I know. This is one of the versions. Now, we are cutting the graph between node 7 and 8. Commented Mar 28, 2018 at 7:28
• This abomination can be used as a starting point: With[{v = 7}, (Subgraph[g1, #, VertexLabels -> "Name"] & /@ WeaklyConnectedComponents@EdgeDelete[g1, Map[v <-> # &, #]]) & /@ Subsets[#, If[Length@# > 1, {1, Length@# - 1}, {}]] & @ AdjacencyList[g1, v]] - it lists all combinations of subgraphs for which v is connected to at least one, and at least one edge to v has been removed. Commented Mar 28, 2018 at 8:12
• Just like with your previous questions that featured this graph, the problem is not very clearly stated. Can you explain the problem in a mathematically unambiguous way? As far as I can see you simply selected an arbitrary edge incident to vertex 7 (look up IncidenceList) and removed it (look up EdgeDelete). Commented Mar 28, 2018 at 10:52
• If these two functions don't solve the problem, can you elaborate? Commented Mar 28, 2018 at 11:34