This is a code implementation release for CVA, short for Community Vulnerability Assessment, from the paper
**********************************************************************************************************
* Are Communities As Strong As We Think?							 			*
* Md Abdul Alim, Alan Kuhnle, and My T. Thai			                         			*
* IEEE/ACM International Conference on Advances in Social Network Analysis and Mining (ASONAM), 2014.    *
* Email: alim@cise.ufl.edu  			                                                        *
**********************************************************************************************************
Please cite the above paper if you happened to use this code in your research. Thank you!

-------------
 Instruction 
-------------
1. Input file
For CVA, there are three types of input file needed: the base graph file, the community input file and the edge removal count file required for breaking density based communities. 

1.1 The Base file
The input base file should be an edge list of the form "u v" where u and v are node IDs starting from 1. This edge list is of an undirected unweighted graph, so you don't need "v u" when "u v" was already in the list. PLEASE MAKE SURE THAT THE INPUT FILE DOES NOT CONTAIN DUPLICATE EDGES.
For example, the content of "input.txt", a sample input file can contain
1 3
5 2
8 7
8 9
7 2
.....

1.2 The community input file
This file contains the vertices of each community. Each line signifies a single community. The fist line comprises the vertex list of community number 1. 
For example, the content of "community.txt", a sample input file for communities can contain
1 7 90 96 148 220 320 
1 28 55 120 325 330 
1 33 94 138 168 311 338 
1 37 109 128 136 185 198 252 282 285 310 321 
......

1.3 The deleted edge count file
This file contains the vertices of each community. Each line signifies a single community. The fist line contains total vertex count, total community count and total edge count while the third element is optional. The second line contains the total edges needed to break the community, total vertex and total edge of community 1. The edge count is optional.
For example, the content of "deleted_edge_count.txt", a sample input file for deleted edge count 
5000 1233 5000
2 4 6
2 4 6
2 4 6
2 4 6
2 4 6
1 4 5
........

2. Output file
The output file name would be given as input parameter. The first element is the community broken, total edges removed, percentage of edges removed, total cumulative edges of the broken communities
For example, 
1 4 4 90
2 9 5 168
3 9 5 180
4 9 4 192
5 9 4 215
6 9 3 226
7 14 4 292
8 14 4 303
9 14 4 314
10 16 4 377
.....

3. Command line
--
The command line should be in the form "java main <base_file> <community_file> <deleted_edge_file> <output_file> <K> <absolute/percentage>" where K is the number of communities to be broken and absolute/percentage indicates whether the top k communities are absolute numbers or the percentage of total communities
For example:
	java main n2500mu015 n2500mu015_community n2500mu015_deleted_edge_count n2500mu015 10 absolute


------
 Note
------
0. The code is implemented on NetBeans IDE 7.0.1. We thank NetBeans for providing this software.
2. Of course, the authors expect this release is clear of bugs. However, if you find any program bugs or memory issues, please contact the corresponding author via "alim@cise.ufl.edu". We highly appreciate your cooperation.
3. three real social trace that we used in the above paper are provided for your convenience in the "real" folder. Synthesized data is included in the "synthetic" folder.
