• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Railway - Search Algorithm

 
Greenhorn
Posts: 6
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good evening!  


I have a question, or..maybe more.

I have this project to do(deadline 09 June 23:59) :

A basic wooden railway set contains the pieces shown in Figure 3 The task is to connect these pieces into a railway that has no overlapping tracks and no loose ends where a train could run off onto the floor.

                                       a. Suppose that the pieces fit together exactly with no slack. Give a precise formulation of the task as a search problem.
                                       b. Identify a suitable search algorithm for this task and explain your choice.

Figure 3 should be something like :





Firstly, I'm not asking for explicit help. I'm looking forward to using my tiny brain in order to finish this project  
Why java? because I am quite familiar with this programming language since I've worked with it a little bit more than with others.


I wasn't home(Didn't have my laptop with me) today and I've thought it was a good idea to analyse those pieces and even try to find a working solution since I couldn't do anything else. Of course it should be a round(kind of) circuit since being a closed circuit is a must.

I found this solution.


This was funny but now I need to code.  

I've thought about using the DFS' principle, creating a class for each type of piece, one for the railway, one for the specific algorithm which I should adapt to my problem. Only God knows for what other things I should do this but I'll see it later. For now, that's my idea of solving this.  


Is there any better approach than mine? Thanks a lot  

Aaaand I apologize for not being word-perfect in English in case I have any mistakes in this topic.
 
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cristian Gabriel wrote:This was funny but now I need to code.



Really? The instructions you posted don't mention writing any code at all.

And even if you are supposed to write code, before you start doing that you should "identify a suitable search algorithm" before writing any code.
 
Bartender
Posts: 2325
100
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cristian Gabriel wrote:...I found this solution...


Looking at it, I can visually see more than 10 20 solutions already. I think there may be more.
 
Saloon Keeper
Posts: 3407
149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many more even. Rotating, mirroring, it is not given that all pieces must be used.

The fact that there may not be loose ends where the train could derail, is an important fact in the mission statement.
 
Ranch Foreman
Posts: 3298
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I count 30 variations that (a) use all pieces, (b) exclude all mirrored and rotationally symmetric variations, and (c) keep the same topology and curved piece orientation as the solution shown.  Many more are possible if we violate those. Violating 3 makes the counting more complicated; it seemed a good place to stop.
 
Bartender
Posts: 1244
86
Hibernate jQuery Eclipse IDE Angular Framework Spring MySQL Database AngularJS Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to avoid copyright infringement, will you please quote the resource? where did the question come from?
 
Cristian Gabriel
Greenhorn
Posts: 6
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know there are more combinations available, just made one using all the pieces.

Develop a software for experimenting with heuristic search algorithms for problem solving. The project is focused on the development of skills for programming search algorithms, covering coding, design, documentation and presentation of results.
You must produce a set of deliverables including: a technical report, source code and experimental data.

More about source code -> The source code should contain the source modules of your software. The software should be developed using a programming language of your choice. You are free to choose a programming language for developing your project.
Some suggestions are: C, C++, Java, Prolog, and Python, so you are free to choose the programming language that best fits your preference. The choice of the programming language must be explicitly motivated in the technical report.
The source code must contain the complete sources of your application, including source files, header files, as well as makefiles or other project configuration files. The code must compile and build using open tools and must not contain any dependencies of integrated development environments.



The documentation should be in LaTeX and a lot of other details but not-so-relevant in my opinion.
 
salvin francis
Bartender
Posts: 2325
100
Google Web Toolkit Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cristian, I think you misunderstood Ganesh's question. Can you share the source of the question (as in, is this an assignment given by your College/University/Job Interviewer/etc ... ?)
I am sure you're not expecting us to solve the complete problem for you. Additionally, if you post a complete solution here, any other candidate who receives the same assignment may come across this thread and simply copy-paste it.

Paul has mentioned a valuable point that you need to identify a suitable search algorithm. Have you identified one ?
 
The only cure for that is hours of television radiation. And this tiny ad:
Java Code Review and Psychology
https://coderanch.com/t/714798/java/Java-Code-Review-Psychology
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!