Giter VIP home page Giter VIP logo

nuces-graph's Introduction

NUCES Graph

C based Graph Theory Library

NUCES Graph is a simple C based library that can be used to analyze small to medium sized graph networks. The code in the library is continuously improved and developed by students (as a learning effort) taking the course CS629 Networks & Graph Theory at the National University of Computer and Emerging Sciences (NUCES), Peshawar, Pakistan.

Installation

For compilation of the library, run ./configure.sh, followed by make. This will add relevant linking files to the lib folder.

For compilation of tests included in the library, run make tests, which are then accessible in the tests folder.

For a system-wide installation, run make install with super user privileges. The installation defaults to /usr/local/lib for linking files, and /usr/local/include for the header files. To change the default location, pass the new location to configure script as ./configure.sh --prefix=/new/location.

Lastly, configure the LD_LIBRARY_PATH environment variable to point to the installation location. Otherwise, you have to specify this location every time you run your code.

Example Usage

#include <nucesGraph.h>

int main(int argc, char **argv)
{
    int i, def_weight = 1;

    nGraph G = newGraph("G");

    for (i = 0; i < 5; i++) {
        addVertex(&G, i);
    }

    for (i = 0; i < 5; i++) {
        addRandomEdge(&G, def_weight);
    }

    addEdge(&G, 0, 1, def_weight);
}

For compiling this code, run gcc code.c -lNucesGraph. Specify the include and linking file locations using -I and -L if necessary (E.g. gcc code.c -I/usr/local/include -L/usr/local/lib -lNucesGraph).

To run the code, run directly as ./a.out, or if the LD_LIBRARY_PATH is not configured, as LD_LIBRARY_PATH=/location/of/lib/folder ./a.out.

Documentation

The documentation is provided as doxygen generated pdf and html pages. The HTML pages can be generated using make doc while the pdf can be generated using make docpdf.

Uninstall

The build directory can be cleaned using make clean. System wide installation can be reversed by calling make uninstall with super user privileges.

nuces-graph's People

Contributors

omar-khan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.