From 09dd5fab90b50563379d07f96827f48315dc11ca Mon Sep 17 00:00:00 2001 From: Gheiserton Date: Mon, 24 Jul 2023 21:29:10 -0400 Subject: [PATCH] add project12 --- Project12/Project12.cpp | 37 ++++++++ Project12/Project12.sln | 31 +++++++ Project12/Project12.vcxproj | 138 ++++++++++++++++++++++++++++ Project12/Project12.vcxproj.filters | 17 ++++ Project12/digraph.h | 31 +++++++ 5 files changed, 254 insertions(+) create mode 100644 Project12/Project12.cpp create mode 100644 Project12/Project12.sln create mode 100644 Project12/Project12.vcxproj create mode 100644 Project12/Project12.vcxproj.filters create mode 100644 Project12/digraph.h diff --git a/Project12/Project12.cpp b/Project12/Project12.cpp new file mode 100644 index 0000000..8c48e87 --- /dev/null +++ b/Project12/Project12.cpp @@ -0,0 +1,37 @@ +// Corey Williams +// COP3530 01Z +// Project 12 + +/* +Create an application that will build a directed graph, G = (V,E); refer to pg. 391. +The user will be prompted for the graph elements using a loop. + + User will provide the number of nodes, N + User will provide the connectivity information (i.e., + "whether edge exist between all combination of points", e.g., 2 to 4) stored in an N x N, 2-D array. + Use the adjacency matrix representation described on pg. 393 + Application will create the nodes and build the graph using information stored in the 2-D array (passed to "Graph" constructor). + +The "Graph" class will be composed of a vector, V, of "GraphNode" objects + + The data members of the "GraphNode" class will be as follows. + pointNum "int" + connectedNodes "vector of pointers/references" // this will be a vector to this "GraphNode" type; storing all adjacent nodes + The "addGraphNode" method will add a "GraphNode" object to the "GraphNode" vector, V. + This method will require connectivity information also, which describes how the new node is connected to the other nodes in the graph. + + +Notes + The "Graph" class will represent the graph as an adjacency list (see Figure 8.2 (c) pg. 394. + The only difference being that the Project 12 Description is using vectors instead of + linked list where possible to simplify the implementation. + For C++ code, the "Graph" class should also have a destructor to release the allocated memory of the "GraphNode" objects. + +*/ + +#include +#include "digraph.h" + +int main() { + +} \ No newline at end of file diff --git a/Project12/Project12.sln b/Project12/Project12.sln new file mode 100644 index 0000000..6f45e09 --- /dev/null +++ b/Project12/Project12.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33122.133 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project12", "Project12.vcxproj", "{9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}.Debug|x64.ActiveCfg = Debug|x64 + {9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}.Debug|x64.Build.0 = Debug|x64 + {9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}.Debug|x86.ActiveCfg = Debug|Win32 + {9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}.Debug|x86.Build.0 = Debug|Win32 + {9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}.Release|x64.ActiveCfg = Release|x64 + {9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}.Release|x64.Build.0 = Release|x64 + {9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}.Release|x86.ActiveCfg = Release|Win32 + {9B06F161-5AA3-4CC1-AD2A-CBD842C5B982}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {365A5217-EC9F-4299-B51E-1CF49F645D67} + EndGlobalSection +EndGlobal diff --git a/Project12/Project12.vcxproj b/Project12/Project12.vcxproj new file mode 100644 index 0000000..9de571c --- /dev/null +++ b/Project12/Project12.vcxproj @@ -0,0 +1,138 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + 16.0 + Win32Proj + {9b06f161-5aa3-4cc1-ad2a-cbd842c5b982} + Project12 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + diff --git a/Project12/Project12.vcxproj.filters b/Project12/Project12.vcxproj.filters new file mode 100644 index 0000000..a8a6563 --- /dev/null +++ b/Project12/Project12.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + \ No newline at end of file diff --git a/Project12/digraph.h b/Project12/digraph.h new file mode 100644 index 0000000..74e30bd --- /dev/null +++ b/Project12/digraph.h @@ -0,0 +1,31 @@ +#ifndef GRAPH_H +#define GRAPH_H + +#include + +using namespace std; + +class graphNode { +private: + int pointNum; + vector connectedNodes; + + +public: + graphNode() { + + } + int getPointNum() { + return pointNum; + }; + vector getConnectedNodes() { + return connectedNodes; + } + +}; + +class graph { + +}; + +#endif \ No newline at end of file