Quantcast
Channel: Deleting vertices from a Graph and preserving structure - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 3

Deleting vertices from a Graph and preserving structure

$
0
0

My goal is to remove vertices from graphs (and the edges from them) and then take GraphComplement to find out cut sets in graphs with sink and source such as here. So

How can I delete vertices from a graph and preserve the earlier structure?


Trials

Trial 1. Failures in trying to remove vertices fom HararyGraph.

The structure is not preserved for which SetProperty (?) and the repetitive assignment after each removal failing -- the table below removes the other vertex from new graph not from the one where one vertex was already removed.

enter image description here

Trial 2. Failure in trying to remove vertices repetively from GridGraph, based on the case where only one removal.

enter image description here

Trial 3. Question here to be more clear.

SeedRandom[10801];dimension = 5;coDimension = 10;percProbability = 0.7;deleteMe =  Pick[Table[i, {i, 1, 30}], Table[RandomReal[] > 0.5, {i, 30}]]g = GridGraph[{dimension, coDimension}, VertexLabels -> "Name",   ImagePadding -> 30]H = SetProperty[VertexDelete[g, #],     VertexCoordinates -> Delete[GraphEmbedding[g], #]] & @@ deleteMeH = SetProperty[VertexDelete[g, deleteMe],   VertexCoordinates -> Delete[GraphEmbedding[g], deleteMe]]

enter image description here

We are searching for perhaps relevant questions below.

Ps. For the mincut goal, Alert! Alert about bug in at least 10.1 Mathematica in using Mathematica's own cut command: Finding the minimum vertex cut of a graph. Also notice that VertexConnectivity command bugging, Is there something wrong with VertexConnectivity.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>