# Revision history [back]

### How to check if a graph has a given subgraph?

Suppose I consider the Petersen graph G. I want to check if G has the following subgraph H as a subgraph or not, where H=Graph({1:[2,3,4]}). Is it possible to check this? I am new to sagemath.

I wrote the code like this: G=graphs.Petersen_Graph() H=Graph({1:[2,3,4]})

How to write a code which can check if H is an induced subgraph of G or not? Can someone please help me out?

### How to check if a graph has a given subgraph?

Suppose I consider the Petersen graph G. I want to check if G has the following subgraph H as a an induced subgraph or not, where H=Graph({1:[2,3,4]}). Is it possible to check this? I am new to sagemath.

I wrote the code like this: G=graphs.Petersen_Graph() H=Graph({1:[2,3,4]})

How to write a code which can check if H is an induced subgraph of G or not? Can someone please help me out? 3 None

### How to check if a graph has a given subgraph?

Suppose I consider Consider the Petersen graph G. G. I want to check if G G has the following subgraph H a given graph H as an induced subgraph or not, where H=Graph({1:[2,3,4]}). not. Is it possible to check this? I am new to sagemath.SageMath.

I wrote the code like this: G=graphs.Petersen_Graph() H=Graph({1:[2,3,4]})this:

G = graphs.PetersenGraph()
H = Graph({1: [2, 3, 4]})


How to write a code which can check if H H is an induced subgraph of G G or not? Can someone please help me out?not?