Index: trunk/code/projects/traffic_navigation/mapping.h
===================================================================
--- trunk/code/projects/traffic_navigation/mapping.h	(nonexistent)
+++ trunk/code/projects/traffic_navigation/mapping.h	(revision 1973)
@@ -0,0 +1,33 @@
+#include "intersectData.h"
+
+/* Data is sent in the following order
+ * INT0_NUM OUTEDGE_0 OUTEDGE_1 ... \n
+ * INT1_NUM OUTEDGE_0 ... \n
+ * ...
+ * ...
+ */
+
+/* Representation of an edge (road) */
+typedef struct {
+	char to;	/* Where does this edge lead to? */
+	char dist;	/* Where does it come from?	*/
+}edge
+
+/* Representation of an intersection on the graph */
+typedef struct {
+	char type; 	/* Note that there are at most 5 intersection types */
+	char intNum;	/* What is the intersection number */
+	char numOut;	/* Note that we can have no more than 4 outgoing edges */
+	char outSeen;	/* The number of the outgoing edges that we have seen for this intersection */
+	edge[4] outgoingEdges;  
+}node
+
+/* A union that is used in wireless transmissions */
+typedef union  {
+	node n;
+	char array[12];
+}node_union
+
+/* This array holds all of the intersections that are represented in the graph
+ * after its creation, the graph is transmitted wirelessly */
+node[NUM_FEATURES] intersections; 
Index: trunk/code/projects/traffic_navigation/mapping.c
===================================================================
--- trunk/code/projects/traffic_navigation/mapping.c	(nonexistent)
+++ trunk/code/projects/traffic_navigation/mapping.c	(revision 1973)
@@ -0,0 +1,137 @@
+#include ""
+#include "mapping.h"
+#include "lineDrive.h"
+#include <dragonfly_lib.h>
+
+//The last intersection that we encountered
+int lastInt;
+
+
+/* 
+ * Traverses the map using DFS 
+ * Returns 0 if all of the intersections in the database were seen
+ * 1 otherwise 
+ */
+int createMap(){
+
+    int seenout_count = 0;			/* The number of intersections we have completely seen */
+    //int hist_count = 0;			/* The size of our history stack */ 
+
+    char[NUM_FEATURES] seen;		/* Have we seen this node? */
+    char[NUM_FEATURES] seenout;		/* Have we seen the outoging edges of this node? */
+    //char[NUM_FEATURES] history;		/* A stack representing the history */
+
+    int i;
+    int outEdges, currInt, chosenEdge;
+
+
+    /* Initialize all of these arrays */
+    for(i = 0; i<NUM_FEATURES; i++) {
+            seen[i] = 0;
+            seenout[i] = 0;
+            history[i] = 0;
+            intersections[i].type = 0;
+            intersections[i].intNum = 0;
+            intersections[i].numOut = 0;
+            intersections[i].outSeen = 0;
+            intersections[i].outgoingEdges[0].to = 0;
+            intersections[i].outgoingEdges[0].dist = 0;
+            intersections[i].outgoingEdges[1].to = 0;
+            intersections[i].outgoingEdges[1].dist = 0;
+            intersections[i].outgoingEdges[2].to = 0;
+            intersections[i].outgoingEdges[2].dist = 0;
+            intersections[i].outgoingEdges[3].to = 0;
+            intersections[i].outgoingEdges[3].dist = 0;	
+    }
+
+
+        /* Drives to the nearest intersection */
+        barcode = nextInt();
+
+        while(seenout_count < NUM_FEATURES)
+        {
+                currInt = getIntersectionNum(barcode);
+                seen[currInt] = 1;
+
+                /* Get the number of outgoing edges */
+                outEdges = getNumOut(getIntersectType(currInt));
+
+                /* Randomly choose an outgoing edge that we have not seen to go down 
+                 * if no such edge exists */
+                chosenEdge = rand() % outEdges;
+
+                /* We have not seen all the outgoing edges */
+                if(!seenout[currInt]){
+                        intersection[currInt].outSeen++;
+                        /* We have finished seeing all outgoing edges of the intersection */
+                        if(intersections[currInt].numOut == intersection[currInt].outSeen){
+                                seenout[currInt] = 1;
+                                seenout_count ++;
+                        }
+                }
+                /* Traverses edge, stores information in struct */
+                traverseEdge(chosenEdge, &(intersection[currInt].outgoingEdges[chosenEdge]));
+        }
+
+        /* We are done traversing send the graph to the robots */
+        sendIntersectionGraph();
+
+
+        return 0;
+}
+
+/* Given an intersection type, returns the number of outgoing edges */
+int getNumOut(int type) {
+    switch(type){
+        case 0: return;
+        case 1:	return; 
+        case 2:	return; 
+        case 3:	return;
+        case 4:	return;
+    }
+
+    return -1;
+}
+
+
+/* Creates an edge in the graph */
+int insertEdge(){
+
+}
+
+
+/* 
+ * Drives to the next intersection and returns its ID
+ * If we are at a dead end, returns -1
+ */
+int nextInt(){
+
+}
+
+
+/*
+ * Given an intersection node returns an integer that
+ * can be sent wirelessly
+ *
+ */
+int encodeNode(node n){
+
+
+}
+
+/*
+ * Uses wireless to send the graph sructure
+ * to other robots
+ *
+ * @return 
+ *
+ */
+void sendIntersectionGraph() {
+        int i;
+        node_union graph;
+
+        for(i=0; i< NUM_FEATURES; i++){
+                graph.n = intersctions[i];
+                wl_basic_send_global(42, graph.array, 12);
+        }
+}
Index: trunk/code/projects/traffic_navigation/Makefile
===================================================================
--- trunk/code/projects/traffic_navigation/Makefile	(revision 1972)
+++ trunk/code/projects/traffic_navigation/Makefile	(revision 1973)
@@ -5,7 +5,7 @@
 COLONYROOT := ..
 
 # Target file name (without extension).
-TARGET = main
+TARGET = sendGraph
 
 # Uncomment this to use the wireless library
 USE_WIRELESS = 1
