Git Product home page Git Product logo

graphpl's Introduction

graphpl

Package for SWI prolog to manage graphs.

Basic info

A graph, in this package is represented in this way: graph(ListOfVertices,ListOfEdges) where ListOfVertices is a list of integer and ListOfEdges is a list of predicates edge/2 or edge/3 where edge/2 is used to for unweighted graphs (edge(NodeA,NodeB)) and edge/3 is used for wheighted graphs (edge(NodeA,NodeB,Cost)).

Predicates Available

  • make_undirected_unweighted_graph/2
  • make_undirected_weighted_graph/2
  • make_unweighted_graph/2
  • make_weighted_graph/2
  • find_path_unweighted/4
  • find_path_weighted/5
  • make_kn/2
  • make_kn_weighted/4
  • make_kn_from_vertices/2
  • cycle_unweighted/3
  • cycle_weighted/4
  • is_connected/1
  • node_degree/3
  • node_degree_list/2
  • empty_unweighted_graph/3
  • empty_weighted_graph/3
  • is_graph_node/2
  • is_isolated_node/2
  • is_graph_edge/2
  • get_adjacent_nodes/3
  • graph_reverse_edges/2
  • spanning_tree/2
  • mst_prim/3

Example

:- use_module(library(graph)).

test(G):-
      make_kn(4,G).

?- test(T).
T = graph([1, 2, 3, 4], [edge(1, 2), edge(1, 3), edge(1, 4), edge(2, 3), edge(2, 4), edge(3, 4)]).

Contribution

Feel free to open an issue if you found some problems or pull request if you want to contribute. Feel free also to suggest predicates that could be good to have.

graphpl's People

Contributors

damianoazzolini avatar

Watchers

Tadeusz Kurpiel 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.