Order For Similar Custom Papers & Assignment Help Services

Fill the order form details - writing instructions guides, and get your paper done.

Posted: June 15th, 2022

Develop a program to read simple undirected connected graphs into an n x n 2D array.

Develop a program to read simple undirected connected graphs into an n x n 2D array.

CMPS 2433 – Discrete Structures and Analysis

Program 4

Due December 4, 2018

Problem: Homework help – Write a program to read simple undirected connected graphs into an n x n 2D array. Then

determine whether that graph has an Euler Circuit using the algorithm described below. If the graph has

an Euler circuit, find one and print out the nodes in the Euler Circuit. If the graph does not have one,

print NO EULER CIRCUIT EXISTS.

Method: First your program must determine if the connected graph input and stored in the 2D array has

an Euler Circuit. A graph that has vertices of all even degree contains an Euler Circuit. Second, if the

graph does have one, then your program must find an Euler Circuit in the graph using a modification of

Fleury’s algorithm.

Fleury’s algorithm, published 1883 constructs Euler subcircuits by first choosing an arbitrary vertex (say

0) of a graph, and forms a circuit by choosing edges successively. Once an edge is chosen, it is removed.

Edges are chosen successively so that each edge begins where the last edge ends, and so that this edge

is not a cut edge, unless there is no alternative. The algorithm terminates when the original vertex (0) is

reached. If there are no edges remaining in the graph, then the path has the constructed Euler circuit,

otherwise it has only found a subcircuit. Just stop there and print out a message that only a subcircuit

was found.

Important Notes:

 You must use arrays or vectors in this program.

 If you use arrays, you must dynamically allocate memory for each array and properly free up

that memory when you finish processing that particular graph (array).

 You must write functions to

o Open the input and output files

o Read in the graph’s edges

o Determine if a graph has an Euler Circuit

o Find and print an Euler Circuit using Fleury’s algorithm

o Determine if a graph has edges

 There will not be more than 20 vertices.

 Vertices are labelled 0, 1, 2, …

Input File: connected2D.dat

Sample input file: 3 //number of test cases

6 //number of rows and columns in the 2D array

0 1 0 0 0 1 //values in the 2D array

1 0 1 0 0 0 //DRAW the GRAPH on the input file

0 1 0 1 1 1

0 0 1 0 1 0

0 0 1 1 0 1

1 0 1 0 0 0

4 //number of rows and columns in the 2D array

0 1 1 1 //values in the 2D array

1 0 1 1 //DRAW the GRAPH on the input file

1 1 0 1

1 1 1 0

7

0 1 0 1 0 0 0

1 0 0 1 0 0 0

0 0 0 1 1 0 0

1 1 1 0 1 1 1

0 0 1 1 0 0 0

0 0 0 1 0 0 1

0 0 0 1 0 1 0

Output File: lastname_prog4.txt

Sample output file: Joanna Wringer

Euler Circuit: There are 3 Graphs

GRAPH 1

0 1 2 3 4 2 5 0

EULER CIRCUIT CONSTRUCTED

GRAPH 2

NO EULER CIRCUIT EXISTS

GRAPH 3

0 1 3 0

A SUBCIRCUIT CONSTRUCTED

Order | Check Discount

Tags: best essay writing service tiktok, best essay writing service uk, best essay writing service uk trustpilot, best research paper writing service, Best Research Paper Writing Services in the U.S.

Assignment Help For You!

Special Offer! Get 20-25% Off On your Order!

Why choose us

You Want Quality and That’s What We Deliver

Top Skilled Writers

To ensure professionalism, we carefully curate our team by handpicking highly skilled writers and editors, each possessing specialized knowledge in distinct subject areas and a strong background in academic writing. This selection process guarantees that our writers are well-equipped to write on a variety of topics with expertise. Whether it's help writing an essay in nursing, medical, healthcare, management, psychology, and other related subjects, we have the right expert for you. Our diverse team 24/7 ensures that we can meet the specific needs of students across the various learning instututions.

Affordable Prices

The Essay Bishops 'write my paper' online service strives to provide the best writers at the most competitive rates—student-friendly cost, ensuring affordability without compromising on quality. We understand the financial constraints students face and aim to offer exceptional value. Our pricing is both fair and reasonable to college/university students in comparison to other paper writing services in the academic market. This commitment to affordability sets us apart and makes our services accessible to a wider range of students.

100% Plagiarism-Free

Minimal Similarity Index Score on our content. Rest assured, you'll never receive a product with any traces of plagiarism, AI, GenAI, or ChatGPT, as our team is dedicated to ensuring the highest standards of originality. We rigorously scan each final draft before it's sent to you, guaranteeing originality and maintaining our commitment to delivering plagiarism-free content. Your satisfaction and trust are our top priorities.

How it works

When you decide to place an order with Dissertation App, here is what happens:

Complete the Order Form

You will complete our order form, filling in all of the fields and giving us as much detail as possible.

Assignment of Writer

We analyze your order and match it with a writer who has the unique qualifications to complete it, and he begins from scratch.

Order in Production and Delivered

You and your writer communicate directly during the process, and, once you receive the final draft, you either approve it or ask for revisions.

Giving us Feedback (and other options)

We want to know how your experience went. You can read other clients’ testimonials too. And among many options, you can choose a favorite writer.