A problem with the greedy approach to finding a maximal matching

Suppose I have an undirected graph with four vertices $ a,b,c,d$ which are connected as in a simple path from $ a$ to $ d$ , i.e. the edge set $ \{(a,b), (b,c), (c,d)\}$ . Then I have seen the following proposed as a greedy algorithm to find a maximal matching here (page 2, middle of the page)

Maximal Matching (G, V, E): M = [] While (no more edges can be added)      Select an edge which does not have any vertex in common with edges in M      M.append(e) end while return M 

It seems that this algorithm is entirely dependent on the order chosen for which edge is chosen first. For instance in my example if you choose edge $ (b,c)$ first, then the you will have a matching that consists only of $ (b,c)$ .

Whereas if you choose $ (a,b)$ as your starting edge, then the next edge chosen will be $ (c,d)$ and you have a matching of cardinality 2.

Am I missing something, as this seems wrong? I have also seen this described as an algorithm for finding a maximal matching in the context of proving that the vertex cover approximation algorithm selects a vertex cover by choosing edges according to a maximal matching. Any insights appreciated.

What is the best approach to giving a label to an ads menu?

I’m developing an mobile lock application for trying a new approach that I hope will replace existing identity check/login methods. In the app’s preferences menu, I want to add a hidden menu which will serve as ads menu, where I can show affiliate ads/product placements. I’m doing this as a seperate menu, because I want to explicitly tell the people that if they interested, they can browse through advertisements, which will support me via affiliate references; if they’re not, there is no ads to disturb the user.

In the drawer (I don’t know what exactly it is called, the black triangle at the bottom of the screen in the image I’m sharing.) I want a simple label text, one or two words, which will describe there lies a menu which contains affiliate ads. How must I approach this? What will suit this best? Must I take an different route to achieve this?

enter image description here

PS. This is my first UI design for an mobile app, it can be quite ugly; sorry about this.

Best approach to having a sort, select and set of action buttons on a table row

Okay so I have a bit of an odd table to achieve and I’m unsure on the the best UI/UX approach to go with.

I have a small table of files, usually at most there would be about 10 files, one of the files must be toggled as a primary file to be used for the category it belongs to. It’s possible to toggle old files as active so each row will have a radio select.

The files will also need to be draggable so that they can be dragged to other file categories. So i need a handle bar for dragging of some sort.

Below I have an example table row labelled to it’s content:

+-------------+--------------+--------------+-------------+ | Grab Handle | Active Radio | file details | edit delete | +-------------+--------------+--------------+-------------+ 

So I’m asking for a few reasons, first is that i know as a general rule it’s best practice to put all action buttons on the right so this may even include the active radio however I’ve seen some tables with selects on the far left except it’s odd to have a handle bar and select next to each other. So would there be a better approach to this or is this fine?

Best approach to having a sort, select and set of action buttons on a table row

Okay so I have a bit of an odd table to achieve and I’m unsure on the the best UI/UX approach to go with.

I have a small table of files, usually at most there would be about 10 files, one of the files must be toggled as a primary file to be used for the category it belongs to. It’s possible to toggle old files as active so each row will have a radio select.

The files will also need to be draggable so that they can be dragged to other file categories. So i need a handle bar for dragging of some sort.

Below I have an example table row labelled to it’s content:

+-------------+--------------+--------------+-------------+ | Grab Handle | Active Radio | file details | edit delete | +-------------+--------------+--------------+-------------+ 

So I’m asking for a few reasons, first is that i know as a general rule it’s best practice to put all action buttons on the right so this may even include the active radio however I’ve seen some tables with selects on the far left except it’s odd to have a handle bar and select next to each other. So would there be a better approach to this or is this fine?

In DnD 5e’s lower magic approach, how would the Red Wizards of Thay’s magic item business work out?

DnD 5e makes magic items much less common than previous editions. Also, the Forgotten Realms are the assumed background even in the Core Rules.

One of the most interesting groups in Faerun are the Red Wizards of Thay, trying to gain money and influence by building enclaves all across Faerun where they produce and sell magic items.

Now these two concepts do not go together well. Still, as Faerun is the assumed background, magic items there are also supposed to be rare (i.e. Faerun is not a particularly high-magic setting).

I want to include the Red Wizards in my upcoming DnD 5e campaign, but I’m unsure how their strategies might work out. Would they rather demand favors and support than money for their magic items? Or are they an exception to the rule that magic items are not for sale, where the flip side of the coin is that every magic item bought supports a magocracy with overt slavery and oppression?

Interval partitioning problem different approach – arrange lectures in minimum number of classrooms

The problem of scheduling lectures in minimum number of classrooms is as follows: Find minimum number of classrooms to schedule all lecture so that no two occur at the same time in the same room.

The common algorithm that I find in books is:

Sort intervals by starting time so that s1 ≤ s2 ≤ ... ≤ sn. d ← 0 //number of classrooms for j = 1 to n {  if (lecture j is compatible with some classroom k)  schedule lecture j in classroom k  else  allocate a new classroom d + 1  schedule lecture j in classroom d + 1  d ← d + 1 } 

Now, I was thinking of an alternate approach where I sort my lectures by finishing times in ascending order and every time I check if lecture j is compatible with some classroom k and there are multiple classrooms that are compatible with that lecture, I schedule it in the classroom which the last jobs finish time in that classroom is closest to that jobs start time, i.e minimise the time a classroom is empty.

Sort intervals by starting time so that f1 ≤ f2 ≤ ... ≤ fn. d ← 0 //number of classrooms for j = 1 to n {  if (lecture j is compatible with some classroom k)  schedule lecture j in classroom k which was used last  else  allocate a new classroom d + 1  schedule lecture j in classroom d + 1  d ← d + 1 } 

I would like to know if this approach is right(not necessarily optimal). I have dry run it on a couple of cases, and looks to be okay. If yes, how can I prove its correctness? If not, how can what changes can I make the algorithm work.

About Commanding in UWP apps. What commanding approach is best? office like?, UWP? or classic win32?

I’m writing an app with platform UWP-Windows 10-1903(Universal Windows), for making electric circuits, designs and simulations. User makes a design on screen with resistors, generators, etc, and run simulations in time and frequency domain. It is intended for professional use, and non-free.

Target devices are Desktop (keyboard + mouse) and Tablet (finger touch). It could be nice to add Phone option, but it couldn’t be possible because Windows Phone died.

I did choose the develop with UWP platform because the Store helps much with the infraestructure for selling the app. Multi device paradigm is also attractive, user could work hard in the desktop, and then check a couple things in tablet mode when he or she is drinking a beer in the bar.

That said, i’m trying to design the commanding pattern.

App will have at least 50 commands, grouped in 10 menus. Remember, app is meant to be pro, and there are many tools and dialogs for helping the user to make his or her design. The app is charged with knowledge in electronics.

(for displaying the data, i don’t use page navigation, I use the SyncFusion Window docking manager, because there could be many windows with data, curves and circuits. To navigate back and forth all time could be annoying)

Possible approaches for commanding are:

  1. “Classic like win32” MenuBar, with icon+text for menuitems. That includes the file menu.
  2. UWP CommandBar at top, with icons, and menu flyouts. Seems nice and attractive.
  3. Ribbon menu bar, and Backstage view (for file commands menu). Like MS Office 2016, 2019.., etc

My question is, which approach should I choose? and why?, i’m like hesitant.

I saw many examples of different Windows and UWP apps. But there isn’t a consistency, and each app seems to follow its own preference.

Examples:

  • Paint 3D: has a top command bar, but with Backstage View for “file menu” commmands.
  • Win10-1903 Classic Paint: Has a Ribbon bar for Home and View Command groups, but with no Backstage View, just a classic file menu at top-left.
  • Office 2019: Full Ribbon menu, with Backstage View for “old file menu”. Settings command in backstage view
  • Microsoft Edge: Has a top command bar, but with the majority of commands grouped as secondary commands, that pops out like a flyout menu with the … button.
  • Win10-1903 3D viewer app: Has a UWP menu-bar (icon+text items), but the file commands are in a simple menu in classic format! (what happened with the backstage view??), another weird thing, the settings (gear icon) command is in the Help menu, not in the file menu.
  • (Store) DrawingBoard-Pro: Has top command bar, but file commands are in a bottom command bar.
  • Windows BuildCast UWP Sample: Navigation pattern with hamburger icon at top-left corner, almost no commanding. Settings command at the bottom of the nav pane.
  • Win10-1903 Video Editor: Has top command bar with a few primary and another few secondary commands. nice example.

All of those different and inconsistent examples gave me doubts about what to do. What approach should I use for my app? for instance, should I put a Backstage view?

Following, I add a side question, a thing that concerns me very much. Seems much of apps in the MS-Store are like toys or crappy.., and not oriented for serious work. I mean there are no serious big apps like a CorelDRAW, and AutoCAD, an Adobe Photoshop, and Autodesk Eagle or so. All of those little apps in the Microsoft Store, looks very nice in their UX, but are very limited in their capabilities (and cheap). And UWP apps that have desktop counterparts, are inferior to their dekstop versions.. (VLC player is an example), why all of this?

I mean, in the store, there are many apps like for viewing the human body atlas, apps for consulting the chemical periodic table, apps for checking the physics laws or calcuting resistors for a voltage divider, apps like social networks, apps for listening music, apps for checking weather, watch movies, play games, e-mail, calendar, etc. It’s like the usage pattern is open app –> use app –> close app.

But there are almost no app with the classic usage for design pattern, like: new or open file –> user edit his or her design –> save file –> share or send by e-mail, or print in paper. It seems like the apps are no more “file oriented”, is that “old fashioned”?

If I’m willing to develop a serious app for making electric/electronic designs, UWP and the MS Store is not best approach or option?, should I develop in WPF?

Thanks in advance, and sorry if I made this extremely long.

Application for javascript using a Media Computation Approach

hope I’m asking in the right place

I am taking on a project called: Javascript using a Media Computation Approach. I am aware this would involve things like manipulating images to do things such aa reducing the pixels.

My question is that does anyone have any suggestions of what I should be considering whilst doing this? I’m thinking of doing a web based application for this.

Also I have been told that this approach has been successful with other languages such as Java and python, what are the benefits of teaching a language this way? And why is this more successful than other approaches?

Thanks in advance