Giter Site home page Giter Site logo

break-network's Introduction

Demonstrates two techniques aimed at breaking apart a graph into smaller, less interconnected components.
Test files are included to demonstrate functionality.

The first technique is removal of nodes in order of highest degree (# of neighbors). The second removes nodes in order
    of highest collective influence, as

Arguments are of form [-d] [-r RADIUS] num_nodes input_file
    -d is optional and instructs us to use removeByDegree() instead of removeByCI()
    -r is optional and instructs us to use RADIUS instead of the default value of r=2
    num_nodes is how many nodes to remove
    input_file is the .txt file containing two numbers per line, describing two connected vertices

   Ex. "-d 4 destruction_example_1.txt" instructs to remove the 4 nodes with highest degree from the example file
       "-r 2 6 destruction_example_2.txt" instructs to remove the 6 nodes with highest CI, updating the CI of every node
            after one is removed.

BreakNetwork.java:
    main(): Parses CLI arguments and calls removeByDegree() or removeByCI() accordingly
    removeByDegree(): Removes [num_nodes] nodes with highest degree
    BFS(): Performs breadth-first search traversal of graph, using an array to track which nodes have been visited.
            A queue holds visited nodes, separated by values of -1 to track changes in depth. If surfaceNodesOnly is true,
            returns only the nodes at exactly [radius] away from root node. If false, it returns those <= [radius] away.
    calculateCI(): Performs collective influence calculation according to project description.
    removeByCI(): Simply calls removeHighestCI() as many times as determined by program arguments.

Graph.java: Adjacency list representation of a graph implemented via HashMap. Stores the nodes in the graph as keys, and
    a set of their neighboring nodes as values.
    getHighestNode(): Determines the size of the visited[] array in BFS().

Future steps:
    Refine removeByCI() so that it does not rely on removeHighestCI() to update the CI of all nodes. Ideally, it should
        only update the CI for nodes whose distance from the removed node is <= RADIUS + 1

Edward Smakov
[email protected]
[email protected]

break-network's People

Contributors

esmakov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.