# Path: CommonDefs.py
# class CommonDefs:
#     '''
#     Class containing some commonly used values
#     '''
#     INT_MAX = "2147483647"
#     INT_MIN = "-2147483648"
#     DBL_MAX = "1.79E+308"
#     DBL_MIN = "1.79E+308"


import sys,getopt
from CommonDefs import CommonDefs
    print "algo=", algo
    data1 = fileToTuples(infile1,delimiter)
    data2 = fileToTuples(infile2,delimiter)
    
    if algo == 'toposort':
	#dependency verification as multiple topo ordering possible
	depen_map = dict()
	for entry in data1:
		vid = int(entry[0])
		val = int(entry[1])
		depen_map[vid] = val
	
	for entry in data2:
		vid = int(entry[0])
		vertex_rank = depen_map[vid]
		dependencies = entry[1].split(",")
		for val in dependencies:
			depen_rank = depen_map[int(val)]
			if vertex_rank <= depen_rank:
				return 1
	return 0

    else:
        if len(data1) != len(data2):
            return 1
        else:
            for i,val in enumerate(data1):
        	if(len(data1[i]) != len(data2[i])):
        		return 1
                if(data1[i] != data2[i]):

# Path: CommonDefs.py
# class CommonDefs:
#     '''
#     Class containing some commonly used values
#     '''
#     INT_MAX = "2147483647"
#     INT_MIN = "-2147483648"
#     DBL_MAX = "1.79E+308"
#     DBL_MIN = "1.79E+308"


# Path: compareoutput.py
import sys,getopt
from CommonDefs import CommonDefs

    print "algo=", algo
    data1 = fileToTuples(infile1,delimiter)
    data2 = fileToTuples(infile2,delimiter)
    
    if algo == 'toposort':
	#dependency verification as multiple topo ordering possible
	depen_map = dict()
	for entry in data1:
		vid = int(entry[0])
		val = int(entry[1])
		depen_map[vid] = val
	
	for entry in data2:
		vid = int(entry[0])
		vertex_rank = depen_map[vid]
		dependencies = entry[1].split(",")
		for val in dependencies:
			depen_rank = depen_map[int(val)]
			if vertex_rank <= depen_rank:
				return 1
	return 0

    else:
        if len(data1) != len(data2):
            return 1
        else:
            for i,val in enumerate(data1):
        	if(len(data1[i]) != len(data2[i])):
        		return 1
                if(data1[i] != data2[i]):

        		if(CommonDefs.INT_MAX in data1[i] or CommonDefs.INT_MAX in data2[i]):