Find Degree for each Node of given graph by Pthread library.
The size of graph can be very large, so you need to parallelize program to multiple threads.
Number of threads to use should be given from command line.

INPUT(graph.txt):
first line contains N, number of cities.
Next N lines contain N numbers (1or 0), if there edge from I city to J city.
example:
4
0 1 1 0
0 0 0 1
1 1 0 1
0 0 0 0

OUTPUT(tour.txt):
Degree of each city separated by space.
example:
3 3 4 2

Hi Alikhan094 and welcome to Daniweb. Can you please provide what code you have come up with so far? You will not find anyone from this great forum that will do your homework for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.