## 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.

## Is there a log(n) approach for this question?

Since it’s sorted, can we have a O(log(n)) approach for the same. Or is the best possible answer O(n) as suggested in the link.

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

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?

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

## 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?

## Best approach to market a software

Hi,
I've built a software that I intend to sell. What do you think would be the best way to approach:

2. Charge for the software and offer an X day full refund.

Any other ideas are appreciated
Thanks

## 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:

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?