Question: How to test a graph whether contains some Specific subgraphs

  Hello: 
    As a first step to my question, let  G be  a graph and  I'd like to know  whether it contains a C4 (cycle of 4) as its subgraph.
     For example: .   It contains C4. So  program may be return true.  
    I'm most concerned about the following thing ( it is important problem for me, since in graph theory, we usually consider some class graphs contain no sepecific graph ) :
   1 Further , I want to  get all connected graphs of order less than 6  which  contains no C4 .
   2 More generally, I want  to konw  a graph  whether contains some graph as its subgraph.For example : does it contain K4CompleteGraph(4)K32  CompleteGraph(3, 2)  and so on ?
    I read the  function subgaph.  But  It didn't solve my problem. Many thanks for your help or advise.
   # I  just know there is a function  IsTriangleFree which test if graph is triangle-free ( graph comtains no C3 in Maple 2019. I think my question and how to program may be  meaningful.

Please Wait...