1. A computer-executable method for pruning a graph, comprising: storing in a storage device of a computer a data set comprising a plurality of data elements; determining, by the computer, a type and strength of relationship between a data element pair in the plurality of data elements; representing the type and strength of relationship as an edge between a vertex pair representing the data element pair in a graph; determining a minimum graph traversal threshold associated with an input query received by the computer for the graph, wherein the minimum graph traversal threshold indicates a minimum number of traversal steps needed for the input query in the graph; identifying that a number of traversal steps for a first connected component in the graph is greater than or equal to the minimum graph traversal threshold, and wherein a connected component includes a set of one or more vertices, which are coupled to each other via edges and are not coupled to a vertex outside of the set; identifying that a number of traversal steps for a second connected component in the graph is smaller than the minimum graph traversal threshold; generating a second graph comprising the first connected component by pruning the second connected component from the graph; and processing the input query on the second graph to extract information of interest from the data set.