Problem hidden
This problem was hidden by Editorial Board member probably because it has incorrect language version or invalid test data, or description of the problem is not clear.

Problem hidden on 2015-12-24 18:50:18 by Jacob Plachta

ISO4371 - ISOMORPH2

no tags 

  1. 1.       Introduction
    Definition :
    An isomorphism from a simple graph G to a simple graph H is a bijection f:V(G) -> V(H) such that uv belongs to E(G) if and only if f(u)f(v) belongs to E(H) . We say “G is isomorphic to H”, if there is an isomorphism from G to H.
    Example : The following two graphs are isomorphic.

input example
         G1                                                                            G2

Our objective in this problem is to find isomorphic graphs.

 

Input

 

 

Input is read from STDIN. Each test case consists of graphs all with same number of vertices. Your task in this assignment will be to divide the given set of graphs into classes within which graphs are pairwise isomorphic. 

k v [k is the number of graphs (<=20) in the test case and v is the number of vertices (<=20) in each of these graphs] 

e1 [number of edges in first graph, call this graph ‘1’]

u1 w1

u2 w2

...

ue1 we1

e2 [number of edges in second graph, call this graph ‘2’]

u1 w1

u2 w2

...

ue2 we2

e3
...

...

...

ek [number of edges in the last graph, call this graph ‘k’]

u1 w1

u2 w2

...

uek wek

[Note: all n graphs themselves are named ‘1’, ‘2’...’n’ in the order in which they appear in the input. Hence the graph with e1 edges is called ‘1’ and so on]
[Note: all graphs are simple & undirected; vertices are labelled with numbers, not alphabets.]

Output

An isomorphic class is simply a list of graphs which belong to it. And Output is written to STDOUT.
The output should follow the below format:
1. Output is a listing of all isomorphic classes, one on each line, sorted in ascending order by the first
graph of the class.
2. Within an isomorphic class, the members are printed in ascending order.
(Thus, the class containing graph ‘1’ is always on line 1.)

Remarks

Problem statement is as described in the assignment pdf. Input output format is also descibed there.

More test cases will be added soon.

Do let us know if you find any errors/hit time limits/etc.

REMEMBER: This is an individual assignment.

 


hide comments
Jacob Plachta: 2015-12-24 18:48:44

This seems identical to http://www.spoj.com/problems/EE4371/ - not sure why both were added, so I'm hiding this one.


Added by:Saketh BSV
Date:2015-04-15
Time limit:1s-10s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 JS-MONKEY