Jump to content

Elemente De Teoria Grafurilor


Recommended Posts

1. Graf_partial

Sa se scrie un program care citeste de la tastatura o matrice de adiacenta asociata grafurilor g si g`,cu cate n noduri fiecare si verifica daca g` este partial pentru g.


int a[20][20], b[20][20],n;

void citire(int x[20][20]){

for (int i=1;i<=n;i++)

for (int j=1;j<=n;j++)



int partial()

{for (int i=1;i<=n;i++)

for (int j=1;j<=n;j++)

if((b[i][j]==i)&&(a[i][j]==0)) return 0;

return 1;}

void main()




cout<<"graful g` este partial pentru g";

else cout<<"nu este";}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.