Table of Contents
-
Whitepaper
1.1 Graphs 101
1.2 How MAP Makes Graphing Easier
1.3 Intended Users
1.4 Properties of Language and Buzzwords
1.5 Conclusion - Contributors
Whitepaper
Graphs 101
Graphs are discrete structures that are made up of nodes (or vertices) and edges that connect these nodes. Graphs can have several properties such as directional edges, multiple edges connecting the same two nodes, and loops. In our language MAP, graphs can have any number of properties that the user desires.
Here is a simple tutorial that will go over the different properties: Graphs can be undirected which means that the edges have no direction. This is often signified by a simple straight or curved line. In the example below, A can go to B and B can go to A. Graphs can have multiple edges connecting the same nodes. C and D can travel between each other in three different ways. Graphs can have a loop which is an edge that connects a node to itself. A node can even have multiple loops. A and B have loops. D has two loops. Instead of undirected graphs, graphs can also be directed. This is often signified by an arrow. Thus, there is a restriction on the edge so that it can only travel in one direction. For instance, A is a directed edge to C because A can go to C, but C cannot go to A. The diagram below is also an example of a mixed graph because it contains directed and undirected edges. Graph models can solve various types of problems in a wide range of fields. To name a few, graphs can be used to denote how different species compete, how employers interact, how researchers collaborate, and how computer networks connect. Graphs can find the number of colors needed to color the regions of a map and find the shortest path between two cities. There are a variety of graph algorithms that a user of our language can experiment with and create.
How MAP Makes Graphing Easier
Even with an elementary knowledge of Graph Theory, programmers tend to find graph representations of data to be abstract and difficult to visualize. Beginner programmers might shy away from graph programming because creating graphs from scratch involves choosing which data structure with which to represent the graph (arrays, lists, etc.), constructing Node and Edge classes that have their own attributes, and having these Nodes and Edges interact in the Graph.
Easy
MAP takes the responsibility of Graph implementation away from the programmer, as it has built-in data types of Node, Edge, and Graph; the programmer now only needs to follow MAP documentation to insert data into Nodes and Edges and then insert them into the Graphs.
Quick and Multipurpose
MAP is also useful to more experienced programmers who want a quick implementation but do not want to sacrifice flexibility in terms of what the Graph can do. For example, MAP allows programmers to customize whether their Graph is directed or undirected (through MAP's DirEdge and UndirEdge datatypes) and what kind of attributes that the built-in data types store (MAP stores attributes of a datatype like Node, Graph, or Edge in associative arrays that allow the programmer to access the data with key-value lookup).
Result-oriented
By clearing the initial hurdles of graph programming, MAP allows programmers to concentrate on deriving meaningful results from their data. While users can define their own functions, MAP has various standard-library functions that tend to be useful when dealing with Graphs, such as functions that find the shortest path between two Nodes based on an attribute (Graph.findShortestPath(node1, node2, attribute)), tests if two paths are equal (Path.equals(Path)), and determines if two Nodes are directly connected with an Edge in a Graph (Graph.adjacent(node1, node2)).
Intended Users
Ideally this language will target those who wish to represent trips using graphs, but it can also be generalized to users who wish to solve graphing problems. The intended users of this program are programmers of any level that wish to manipulate graph data types. The language is simple enough that a beginner will easily be able to learn how to run basic programs using graphs, but also complex enough that a more experienced programmer can run sophisticated algorithms. The user will never need to know how the graph is created or manipulated, and will only need to focus on working with a set of built in functions in our language, or writing their own functions to meet their specific needs.
Properties of Language and Buzzwords
The purpose of MAP is to make graph programming easier, and more approachable for beginners. Because of this, we did our best to make the language follow these guidelines:
Simple and Familiar
MAP coding is simple and familiar, as we tried to model the syntax of existing languages so users will not have to adjust too much to the syntax. MAP abstracts away some of the data structures coding from the programmer’s end, allowing the user to focus on implementing algorithms that work with the graph, instead of getting bogged down in the set-up of the graph. Our language is easy for beginners because we do a lot of the work of graph programming behind the scenes for the user.
Intuitive
The MAP language is intuitive. MAP is an imperative language, much like C, C++, and Java, which makes it instinctive to use for many programmers, or people with very little introduction to programming. It is also similar to some scripting languages, as we modeled some functionality off of Python, and our target language is Python as well.
Reusable
MAP allows for the ability to create functions, which allows the user to write reusable algorithms, or abstract pieces of code to be used over again. Abstracting commonly used code into functions helps with debugging, and keeping programs shorter, but most importantly makes the code in the functions generalized enough to be used again easily.
Conclusion
MAP is a simple, intuitive and reusable solution for various graph programming applications. It can help its users to focus on creating elegant graphing tools by abstracting away many low-level graph implementation details. MAP makes graph programming easier and accessible to any level of programmer.
Contributors
Serena Simkus - Project Manager (@serenasimkus)
Sandya Sankarram - Language Guru
Alex Merkulov - System Architect
Alfred Tan - System Integrator
Tommy Inouye - Verification & Validation Person